Inspecting GC memory/stats

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Mon Nov 10 23:36:49 PST 2014


Hi,

I find myself wondering what do people use to inspect the GC on a 
running process?

Last night, I had a look at a couple of vibe.d servers that had 
been running for a little over 100 days.  But the same code, but 
one used less (or not at all).

Given that the main app logic is rather simple, and things that 
may be otherwise held in memory (files) are offloaded onto a 
Redis server.  I've have thought that it's consumption would have 
stayed pretty much stable.  But to my surprise, I found that the 
server that is under more (but not heavy) use is consuming a 
whooping 200MB.

Initially I had tried to see if this could be shrunk in some way 
or form.  Attached gdb to the process, called gc_minimize(), 
gc_collect() - but it didn't have any effect.

When I noticed gc_stats with an informative *experimental* 
warning, I thought "lets just run it anyway and see what 
happens"... SEGV.  Wonderful.

As I'm probably going to have to wait 100 days for the apparent 
leak (I'm sure it is a leak though) to show itself again, does 
anyone have any nice suggestions whether or not to confirm this 
memory is just being held and never freed by the GC?

Iain.


More information about the Digitalmars-d mailing list