{"id":18014863,"url":"https://github.com/zevv/memgraph","last_synced_at":"2026-03-12T01:38:24.691Z","repository":{"id":150599146,"uuid":"604504747","full_name":"zevv/memgraph","owner":"zevv","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-25T18:15:55.000Z","size":2889,"stargazers_count":21,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-13T13:17:17.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zevv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-21T07:43:56.000Z","updated_at":"2025-03-28T09:51:05.000Z","dependencies_parsed_at":"2023-06-11T17:15:42.536Z","dependency_job_id":null,"html_url":"https://github.com/zevv/memgraph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zevv/memgraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fmemgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fmemgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fmemgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fmemgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zevv","download_url":"https://codeload.github.com/zevv/memgraph/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zevv%2Fmemgraph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30412090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T00:40:14.898Z","status":"ssl_error","status_checked_at":"2026-03-12T00:40:08.439Z","response_time":84,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-30T04:11:25.036Z","updated_at":"2026-03-12T01:38:24.668Z","avatar_url":"https://github.com/zevv.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Memgraph\n\n\u003e \"_It's like rainbow brite vomited all over my screen._\"\n\n![Graph](/img/duc.gif)\n![Graph](/img/tmillions.gif)\n\nMemgraph is a little tool to inspect and visualize the heap usage of your\napplications; it will give you a good idea of the general allocation behavior\nof your code and show things like fragmentation, garbage collection behavior,\nleaking rates, interaction between threads, etc.\n\nMemgraph traces all memory allocations by injecting a tiny shared library that\noverrides `malloc()` and `free()` and friends. Every allocation is drawn in\nreal time in a little gui window with the relative addresses mapped to 2D\nhilbert space; where different colors will be used for different threads. The\nbrightness of the allocations fades with time, showing you which allocations\nare new and which have been around for some time.\n\nMemgraph is not a proper profiler, nor does it provide precise instrumentation.\nInstead it relies on the power of your own visual cortex to get a proper \"feel\"\nabout the application's behavior.\n\nAs a bonus, the displayed graph can be recorded to a video for sharing with\nyour friends and family.\n\n\n## Install\n\nMemgraph is written in Nim, so you will need to have the nim compiler and\nnimble tool available on your system.\n\n\n## Dependencies\n\n- A fairly recent version of the Nim compiler\n- SDL2 libraries + header files, (`libsdl2-dev` or similar)\n- Nim libraries sdl2_nim and npeg (will be downloaded by Nimble for you)\n- Optionally, a working installation of ffmpeg for recording videos\n\n\n## Building\n\n```\nnimble develop\nmake\n```\n\n\n## Usage\n\nJust run `memgraph`, followed by your program and its optional arguments:\n\n```\nusage: memgraph [options] \u003ccmd\u003e [cmd options]\n\noptions:\n  -h  --help         show help\n  -m  --memmax=MB    set max memory size [64]\n  -v  --video=FNAME  write video to FNAME. Must be .mp4\n  -s  --space=SPACE  set 2D space mapping [hilbert]\n\navailable 2D space mappings:\n  hilbert, linear\n```\n\nThis is a nice example command to see memgraph at work:\n\n```\n./memgraph -m 1 find / -xdev\n```\n\n\n## Configuration\n\nMemgraph has a few options which can be configured with command line\narguments:\n\n- `-m  --memmax=MB    set max memory size [64]`\n\n  Configure the maximum memory size to be displayed in the graph, \n  the number in megabytes; when not specified, the default is 1024 (1Gb)\n\n- `-v  --video=FNAME  write video to FNAME. Must be .mp4`\n\n  Record the graph to mp4 format, write the result to the file `PATH`.\n  To use this option you need a working installation of ffmpeg on your machine.\n\n- `-s  --space=SPACE  set 2D space mapping [hilbert]`\n\n  Configure the way for mapping memory addresses to a pixel on the screen. \n  The default setting is `hilbert, which provides nice locality.\n\n\n## Miscellaneous\n\n### Non-default allocators\n\nMemgraph only works for applications that use the default C libraries\nallocation functions `malloc()`, `calloc()`, `realloc()` and `free()`. Some\napplications try to outsmart the default allocators by providing their own\nimplementation instead, so memgraph will not be able to hook into those and\ngraph your memory. Notably, Nim programs are default compiled with the internal\nNim allocator. If you want to profile Nim code, make sure to compile it with\nthe `-d:usemalloc` flag.\n\n\n### Glibc heap arenas\n\nFor threaded programs, glibc will default to use more than one heap arena. This speeds\nup the allocator, but can generate confusing memgraph output. Set the following environment\nvariable to make glib use only the main heap arena, which is shared by all threads:\n\n```\nGLIBC_TUNABLES=glibc.malloc.arena_max=1\n````\n\n\n### Under the hood\n\nMemgraph consists of two parts: one small shared library that gets injected\nbefore starting your program using LD_PRELOAD, and the gui program that\ndisplays the memory allocations.\n\n\n```\n  +----------------+\n  |    your app    |\n  +----------------+             +--------------+\n  | libmemgraph.so | ---pipe---\u003e | memgraph gui |  [ ---pipe---\u003e ffmpeg ]\n  +----------------+             +--------------+\n  |      libc      |\n  +----------------+\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzevv%2Fmemgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzevv%2Fmemgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzevv%2Fmemgraph/lists"}