{"id":21483493,"url":"https://github.com/cybershadow/diamond","last_synced_at":"2026-01-04T02:03:36.781Z","repository":{"id":136735026,"uuid":"1093766","full_name":"CyberShadow/Diamond","owner":"CyberShadow","description":"D memory debugger and profiler","archived":false,"fork":false,"pushed_at":"2014-11-19T07:09:19.000Z","size":240,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-30T00:10:03.691Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://thecybershadow.net/d/Memory_Management_in_the_D_Programming_Language.pdf","language":"D","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CyberShadow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"copying","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-11-19T04:16:13.000Z","updated_at":"2025-11-28T11:11:46.000Z","dependencies_parsed_at":"2023-03-14T20:46:12.762Z","dependency_job_id":null,"html_url":"https://github.com/CyberShadow/Diamond","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CyberShadow/Diamond","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberShadow%2FDiamond","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberShadow%2FDiamond/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberShadow%2FDiamond/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberShadow%2FDiamond/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyberShadow","download_url":"https://codeload.github.com/CyberShadow/Diamond/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberShadow%2FDiamond/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28196430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-04T02:00:06.065Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-11-23T12:47:42.720Z","updated_at":"2026-01-04T02:03:36.754Z","avatar_url":"https://github.com/CyberShadow.png","language":"D","funding_links":[],"categories":[],"sub_categories":[],"readme":"Diamond: D Memory Debugger\r\n==========================\r\n\r\nDiamond is a memory debugger and profiler for the D programming language.\r\n\r\nIt has the following components:\r\n\r\n * [a modified runtime (Druntime fork)](https://github.com/CyberShadow/druntime/tree/diamond)\r\n * a post-mortem memory log analyzer, which allows inspecting generated memory logs\r\n\r\nThe modified runtime logs all memory operations to a binary log file,\r\nas well as periodic memory snapshots (before garbage collects).\r\nSome logging options are configurable.\r\n\r\nDiamond aims to mainly facilitate debugging memory leaks (data referenced by bogus pointers).\r\n\r\nD2 support is still under development. The D1 version can be found on the d1 branch.\r\n\r\nThe log file format may change as development continues.\r\n\r\n### Diamond runtime configuration\r\n\r\n * Set `DIAMOND_LOG` to something to enable writing a binary log.\r\n * Optionally, set `DIAMOND_LOGFILE` to the file name for the binary log,\r\n   or `DIAMOND_LOGDIR` to the directory to which it will be written.\r\n\r\n### Diamond runtime API\r\n\r\n * TODO (see `core.diamond.api`)\r\n\r\n### Log analyzer features\r\n\r\n * TODO: update for D2\r\n * uses map files to display symbols in call stacks\r\n * can seek through the log file, allowing to examine the application state at different points in time\r\n * can display \"top allocators\" - call stacks that allocated most bytes\r\n * can filter memory events by address range\r\n * can display a [visual \"memory map\"](http://dump.thecybershadow.net/36ee988fc564aa9ab5529d43662eec81/0000062E.png) (useful for quickly finding large areas the GC shouldn't be scanning for pointers)\r\n * can search for references (pointers) to a certain memory range\r\n * can dump a region of memory to screen\r\n\r\n### Future plans\r\n\r\n * better documentation\r\n * more type information (by hooking higher-level allocators)\r\n\r\nHow to use\r\n==========\r\n\r\n 1. Build D with the Diamond Druntime fork.\r\n    E.g. using [Digger](https://github.com/CyberShadow/Digger):\r\n    `digger build master+CyberShadow/druntime/diamond`\r\n 2. If you enabled memory event logs, enable map file generation in your linker options.\r\n 3. Rebuild your project with the `-g` and `-gs` compiler flags.\r\n 4. Set the `DIAMOND_LOG` environment variable.\r\n 5. Run your project as usual.\r\n 6. Run the memory analyzer when the program terminates.\r\n\r\nFor better stack traces, you'll need to rebuild Phobos with symbols (add `-g -gs` to the relevant makefile).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcybershadow%2Fdiamond","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcybershadow%2Fdiamond","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcybershadow%2Fdiamond/lists"}