Tool for analyzing heap of Linux Glibc (Swift) process in Swift

I would like to present to you a tool I was working on for past few weeks. This tool uses various techniques to look into and analyze memory of other process. The name of the tool is rather boring and uninspired: memtool. At this time, the source code can be found on my Github GitHub - mikolasstuchlik/memtool .

I have started the development of the tool when working on Building `swift-inspect` on Linux - trying to get swift-inspect working on Linux.

And while I was initially confident, that the task to get swift-inspect working is easy enough and could be completed in a few weeks, soon I found out, that the situation is not that easy. There is no easy way of locating HeapObjects on Linux without some hooks. And so the source-code grew in number of lines to a degree, that I have decoded to open a new repo.

I would welcome any feedback, whether you find the tool useful or not.

6 Likes

Would be great with some sample outputs from the 'sample usage' section, it's hard to judge what information one will get with e.g. analyze without downloading/installing/testing (which I might only do if the sample functionality looks interesting). Overall, interesting tool area though, hope to take some time to try it out.

3 Likes

Thanks for the feedback! I will make such a document and let you know. I have had a CLI example usage section, but all the outputs are quite long and I thought it won't look good in the README.

I'll probably take one of the programs from tests and use it as the example.

However, at this stage, there is really no integration with Swift yet (besides the tool being written in Swift). The possibilities are quite open in my opinion. I'll try to integrate it with swift-inspect (forum thread mentioned in the OP) and start from there :)

1 Like

Adding one or more separate markdowns with sample outputs and links to them from the main README would be more than ok :-)

2 Likes

Hi, I have added the examples of the CLI as you suggested memtool/CLI-example.md at master · mikolasstuchlik/memtool · GitHub :slight_smile:

2 Likes