[...]Thread.sleep(10*1000); // to observe initial ram usageDBCursor cur = collection.find();while(cur.hasNext()){DBObject o = cur.next();}cur.close();Thread.sleep(200*1000); // to observe RAM usage after initialization
See here for more background and some random notes I found by
searching on google for "java garbage collection when":
http://javarevisited.blogspot.com/2011/04/garbage-collection-in-java.html
I would suggest setting "cur = null" and then hinting to the JVM to do
garbage collection [system.gc()] and then sleeping, or better yet, run
the test on a sep. thread completely.
> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/mongodb-user/-/rWW58EzBlKAJ.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.
It is totally normal. Even though you lower your batch size, there should be any problem pulling all data to your program. If you need to keep those data in memory, that's another story. That would mean you need to have enough memory to hold those in memory.
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To view this discussion on the web visit https://groups.google.com/d/msg/mongodb-user/-/BBJRzL5ZI3sJ.