[Issue 150] std.gc.minimize doesn't minimize physical memory usage

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 2 06:29:30 PST 2007


http://d.puremagic.com/issues/show_bug.cgi?id=150





------- Comment #1 from thomas-dloop at kuehne.cn  2007-03-02 08:29 -------
updated test code to DMD-1.007

# import gcstats;
# import std.gc;
# import std.stdio;
# 
# void printGC(){
#    GCStats stat;
# 
#    getStats(stat);
# 
#    writefln("poolsize: %s; usedsize: %s; freeblocks: %s; "
#       "freelistsize: %s; pageblocks: %s\n",
#       stat.poolsize, stat.usedsize, stat.freeblocks, 
#       stat.freelistsize, stat.pageblocks);
# }
# 
# int main(){
#    printGC();
# 
#    size_t len = 256 * 1024 * 1024;
#    byte* b = (new byte[len]).ptr;
# 
#    writefln("after allocating %s bytes", len);
#    printGC();
# 
#    delete b;
#    b = null;
# 
#    fullCollect();
#    writefln("after std.gc.fullCollect:");
#    printGC();
# 
#    minimize();
#    writefln("after std.gc.minimize:");
#    printGC();
# 
#    return 0;
# }


-- 



More information about the Digitalmars-d-bugs mailing list