4 Sep 2008 12:05
garbage collector issues
Tomas Stanek <sad0ur <at> psi.cz>
2008-09-04 10:05:44 GMT
2008-09-04 10:05:44 GMT
Hello, I've encountered quite large memory consumption of gauche under some circumstances. My program reads an xml document, converts it into a tree with lots of flonums (sometimes about 20000), do some work with it and continues to another document. The program also allocates few large (up to a megabyte) blocks and lot of pairs/flonums/etc during each iteration. Problem is, that it's memory consuption grows up to 200 - 300MB and never goes down. I've noticed two things... First, Scm_MakeFlonum uses SCM_NEW (not SCM_NEW_ATOMIC) for allocation of the ScmFlonum, which is pointer free. I expectd this to be a "typo". Changing SCM_NEW to SCM_NEW_ATOMIC improves the situation a bit, but not as much. Second, Boehm Weiser GC is by default configured not to use -DUSE_MMAP and -DUSE_MUNMAP flags. This way, GC doesn't ever return allocated memory to the operating system. By using -DUSE_MMAP and -DUSE_MUNMAP, memory consumption keeps around 20 - 30MB. I'm not sure why -DUSE_M[UN]MAP makes a such difference. My speculation is that GC's freelists are poluted with large blocks which are not very usable for future allocations and GC tends to grow heap.(Continue reading)
RSS Feed