简体   繁体   中英

Is there a possible memory problem with lookup array in Java?

I am experimenting with Java and MongoDB and I am making a lookup aggregation. I noticed that when I perform a lookup the document returned contains the lookup field as an Array of documents - as a java.util.ArrayList . So my question here is - what if I have a case where in my lookup array I will have many documents loaded? This may be a problem for my java heap memory?

As long as the single document's size and result-set size is within permissible boundaries of your runtime, you shouldn't see any sluggishness in the response. Also keep in mind the MongoDb driver limitions of BSON Document size of 16MB and pipeline stage memory limit of 100MB without the allowDiskUse command.

Refer the MongoDb doc: https://www.mongodb.com/docs/drivers/java/sync/current/fundamentals/aggregation/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM