Hi,
I’m trying to quantify the difference in memory footprint of a small java app performing the same process multithreaded vs multiprocess.
All my tests are on Linux.
When running multithreaded, it is relatively easy to determine the overall footprint and additional overhead per thread. When running the single threaded process, the JVM has a large footprint (200-300M virtual space) according to pmap. If I run multiple copies of the same app, I see the memory footprint x N and none of the java code is shared between processes.
I have been informed that since java code is really data, not executable, it does not share code between processes as you would with say C executables. However, I was subsequently informed that it may use Copy-On-Write technology to achieve the same thing. If I use pmap, it just tells me the footprint for the process and doesn’t indicate how much may be shared with another process.
So the question is, how would I determine how much data is shared via Copy-On-Write between processes.
Many thanks.