MongoMapper memory leak when querying an array of IDs
I run this query in a rails console
process that has a "5.3%" memory usage开发者_StackOverflow. (User
is a MongoMapper::Document
-included class)
user_ids = ["4de409fc7813b4789d000001", "4de4efdc7813b410e9000007", "4de5297f7813b410e900023b", "4de4f8847813b410e9000037", "4de40eb17813b4788c000009", "4de408787813b4788c000001", "4de522a87813b410e9000072", "4de5238d7813b410fa000090", "4de523877813b410e900009e", "4de526097813b410fa000113", "4de4fd5f7813b410e900003f", "4de522a17813b410e9000070", "4de522597813b410fa000063", "4de525ab7813b410e9000126", "4de522997813b410e900006e", "4de541227813b410e9000319", "4de526ad7813b410fa00013c", "4de4fe5a7813b410fa00003c", "4de522d67813b410fa000075", "4de5238a7813b410e90000a0", "4de4419b7813b4788c00003f", "4de523ec7813b410e90000cf", "4de523467813b410fa00008c", "4de59f557813b45e84000001", "4de553bb7813b449a400007f", "4de8cc757813b4368b00000d", "4df66a2d7813b47c0b000017", "4e0a2ca57813b45f6400000b", "4de7b29f7813b4142800002c", "4e205b537813b4567a000071", "4e1b62a57813b42b9d000092","4e6678371adda36d52000021"]
User.find(user_ids)
It executes successfully, but the memory usage is now "9.1%". Running the command in a 100.times { … }
loop increases the memory indefinitely.
Does anybody know what could explain this?
精彩评论