How to determine JVM memory size with multiple processes on Linux

I am trying to quantify the difference in the memory area of ​​a small java application executing the same process with a multi-threaded and multi-processor interface.

All my tests are under Linux.

When working with a multi-threaded protocol, it is relatively easy to determine the total size and additional overhead for a stream. When starting a single-threaded process, the JVM is large (200-300M virtual space) according to pmap. If I run several copies of the same application, I see the memory area x N, and none of the java code is shared between processes.

I was told that since Java code is bytecode and not executable, it does not pass code between processes, as it would be with the C binaries. However, I was informed that it can use Copy-On technology -Write to achieve the same. If I use pmap, it just tells me about the process trace and does not indicate how much can be transferred to another process.

So, the question is how to determine how much data is transferred through Copy-On-Write between processes?

+4
source share
1 answer

In a properly configured non-embedded Linux system, why do you care about memory usage?

What difference does it make if you had an answer?

Data will only be transferred between processes if one of them was the proper ancestor of the other.
And this will be further determined by the memory layout of the Java program and the data on the pages. All of this can change from release to release.

-3
source

All Articles