Search code examples
javamemoryliferayportlet

DLFileEntry size in the memory


Can someone tell me what is the size of a DLFileEntry record in the memory? I'm holding a List of DLFileEntries and I want to be just sure that my portlet won't have a memory issue after deploying it on a server, operating with a large number of records. Or can someone give me a guide how to obtain this information? Thank you.


Solution

  • You could run a quick test or look at the source and identify members. You're probably referring to the binary data, which is not directly stored in an object of this class. However, it will most likely be cached, so yes, there's some memory overhead. Do you actually need the binary data or will you just hold placeholders without accessing the binary data for all documents that you're holding in memory?

    (Note: The source code I'm linking is the current master branch - check the version that you're actually using and figure out if something changed. As you don't give the version, I'll leave this task for yourself. Also, you might want to check the superclasses (I didn't find anything suspicious in master)