Details
-
Bug
-
Resolution: Won't Fix
-
Major - P3
-
None
-
2.0.4
-
None
-
OS X 10.7.3
-
OS X
Description
The following shell script appears to leak memory in the mongo shell. This is a simplified script to reproduce behavior observed during MapReduce.
> // Fresh start shows the mongo process using 27MB of resident mem.
|
> result = {};
|
{ }
|
> result2 = {};
|
{ }
|
> for (i=0;i<640000;i++) {
|
... result[i] = i * 3 % i;
|
... result2[i] = result + 'aaaaaaaaaaaaaaaaaaaaaaaaa';
|
... db.isMaster()
|
... }
|
{ "ismaster" : true, "maxBsonObjectSize" : 16777216, "ok" : 1 }
|
> // At this point, the process is holding on to 268mb of resident mem
|
> result = 0
|
0
|
> result2 = 0
|
0
|
> i = 0
|
0
|
> gc()
|
> // At this point, the process is holding onto 186mb of resident mem
|
This test assumes that removing references to all JS objects and running gc() would allow all memory to be reclaimed. I'm unsure if SM's GC should behave this way.