size - jvm - what is the optimal freeheap to totalheap ratio? -


What is the optimal freehepse for the total up ratio? Should I consider reducing the size of the heap size / size of the pile on the values ​​of this ratio?

There is no easy answer, let me give you two examples:

Example 1 - Your program allocates 100M light memory at startup, and then does not allocate any memory that is ever for the rest of the part.

In this case, you explicitly

Example 2 - Allocates your program i 100% (100, 99 or something else, but You want to keep a pile size). Memory 10m Anytime no data is no longer than 1 second. (For example, you are calculating a lot for which many temporary data is required, and when you are done you will return an integer ...)

It may be possible to know the exact numbers Not realistic, but this is an example, so bare with me ... Since you have 10m "live" data, you have to be at least 10m heap. In addition, you will need to see how your garbage collector works. Simplified, the time to complete a GC is O (Live Set), i.e. the amount of "Dead" data does not actually enter it. With a constant live set size, your GC time is constant, no matter the size of your heap. It leads to a large pile -> Better throughput

(Now, to actually mess you add stuff like a combination of pile and the image becomes less obvious ...)

> Conclusion This is a simplified version of the case, but briefly the answer is - it depends.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -