www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - GC.collect() and GC.minimize() not releasing memory

reply %u <wfunction hotmail.com> writes:
Hi,

I'm running this piece of code, but the memory isn't getting freed (as judging
from Task Manager). It doesn't help if I call collect() and minimize() in a
loop... is something wrong? Or is Task Manager not a reliable indicator of this?

Thank you!


import std.stdio;
import core.memory;
import core.thread;

void writelnflush(T...)(T args) { writeln(args); stdout.flush(); }
void allocate() { new byte[1024 * 1024 * 64]; }

void main()
{
	writelnflush("Sleeping (check the memory usage!)...");
	Thread.sleep(4 * 10000000);
	writelnflush("Allocating...");
	allocate();
	writelnflush("Collecting...");
	GC.collect();
	GC.minimize();
	writelnflush("Sleeping (check the memory usage!)...");
	Thread.sleep(4 * 10000000);
}
Dec 23 2010
parent reply torhu <no spam.invalid> writes:
This newsgroup is just for automated use by Bugzilla.  You should post 
to d.D or d.learn instead.  Or use the Bugzilla at 
http://d.puremagic.com/issues/ (search before posting a new issue).
Dec 23 2010
parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
On 24/12/2010 06:13, torhu wrote:
 This newsgroup is just for automated use by Bugzilla.
<snip> Where is the official statement of this? Stewart.
Jan 07 2011
parent reply "Simen kjaeraas" <simen.kjaras gmail.com> writes:
Stewart Gordon <smjg_1998 yahoo.com> wrote:

 On 24/12/2010 06:13, torhu wrote:
 This newsgroup is just for automated use by Bugzilla.
<snip> Where is the official statement of this?
Likely there is no hard official statement. However, http://www.digitalmars.com/NewsGroup.html states that it is for "Bug reports for D compiler and library". Those use Bugzilla for bug reports, and free-floating posts in the newsgroup are not tracked like those in Bugzilla, giving them a lot less value. -- Simen
Jan 07 2011
parent reply Walter Bright <newshound2 digitalmars.com> writes:
Simen kjaeraas wrote:
 Stewart Gordon <smjg_1998 yahoo.com> wrote:
 
 On 24/12/2010 06:13, torhu wrote:
 This newsgroup is just for automated use by Bugzilla.
<snip> Where is the official statement of this?
Likely there is no hard official statement. However, http://www.digitalmars.com/NewsGroup.html states that it is for "Bug reports for D compiler and library". Those use Bugzilla for bug reports, and free-floating posts in the newsgroup are not tracked like those in Bugzilla, giving them a lot less value.
That's right. It's just not useful to post free floating posts here. Bug reports should go in bugzilla.
Jan 07 2011
parent "Simen kjaeraas" <simen.kjaras gmail.com> writes:
  Walter Bright <newshound2 digitalmars.com> wrote:

 Simen kjaeraas wrote:
 Stewart Gordon <smjg_1998 yahoo.com> wrote:

 On 24/12/2010 06:13, torhu wrote:
 This newsgroup is just for automated use by Bugzilla.
<snip> Where is the official statement of this?
Likely there is no hard official statement. However, http://www.digitalmars.com/NewsGroup.html states that it is for "Bug reports for D compiler and library". Those use Bugzilla for bug reports, and free-floating posts in the newsgroup are not tracked like those in Bugzilla, giving them a lot less value.
That's right. It's just not useful to post free floating posts here. Bug reports should go in bugzilla.
And right there is your official statement^ :p -- Simen
Jan 07 2011