Skip to content

vimkim/cubrid-memmondiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

memmondiff

Command-line tool for analyzing memory usage changes in CUBRID memmon files using SQL filtering.

Installation

Pre-built Binary

wget https://github.com/vimkim/cubrid-memmondiff/releases/latest/download/memmondiff-linux-amd64

Go Install

go install github.com/vimkim/cubrid-memmondiff@latest

Build from Source

git clone https://github.com/vimkim/cubrid-memmondiff
cd cubrid-memmondiff
go build .

Usage

memmondiff [flags] <before_file> <after_file>

Flags

  • --color: Output coloring (auto, always, never)
  • --pretty-print: Format numbers with commas
  • --sql: Filter results using SQL WHERE clause
  • --raw-query: (experimental) Execute arbitrary SQL queries against the diff data

Basic Examples

# Compare two memmon files
memmondiff before.txt after.txt

# Pretty print numbers
memmondiff --pretty-print before.txt after.txt

# Filter large memory changes
memmondiff --sql "diff >= 10000" before.txt after.txt

Advanced SQL Filtering

# Filter by filename pattern
memmondiff --sql "filename LIKE '%heap%'" before.txt after.txt

# Complex conditions
memmondiff --sql "diff >= 5000 AND filename NOT LIKE '%temp%'" before.txt after.txt

# Raw SQL queries
memmondiff --raw-query "SELECT SUM(diff) FROM entries WHERE diff >= 10000" before.txt after.txt

You can refer to the DDL used to create the internal temporary memory database to customize your raw query (which is subject to change).

CREATE TABLE entries (
    filename TEXT,
    diff INTEGER,
    after INTEGER,
    before INTEGER
)

Screenshots

Linux

image

Raw Query Mode

image

Windows

  • Supported from v0.1.1
  • For building from source, use 'CGO_ENABLED=1'. Zig compiler recommended (see justfile).

Supported Platforms

  • Linux
  • Windows (requires CGO_ENABLED=1)
  • macOS