It also gives the reverse problem: It causes the gc to think there's more garbage and thus makes the gc intervals shorter. If the process is big that might be a serious performance problem.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-03-04 00:01: Subject: Re: Children and Clones
Note that set_weak_flag does not really work all that well, however.
Adding objects to a weak multiset will cause them not to be removed until the garbagecollector is run, which might be a rather long time, especially if your application has been running for quite some time without creating and destroying a lot of objects before.
As an example, my mediaplayer at times got about 20M objects before each gc, which promptly removed about 19.99M of them, causing the memory usage to raise rather quickly.
If you are not creating heaps of objects, however, it will work.
/ Per Hedbor ()