Performance and scalability: java jni c++ measuring memory requirement
- Posted by: Shivanjali Bhutkar
- Posted on: December 01 2005 02:12 EST
i have java code calling c++ code with jni.
I am researching how much memory would be required by application in QA and production.machines used are windows 2000 boxes. I can do only load test for performance on QA machines. I am not sure, how you all find memory requirement for your application which will be put in production.
Please share your experiences how to go about this.
Any new objects created via JNI functions like NewLocalRef will be allocated and tracked in the JVM Heap. But if you have malloc() or new() calls then they come out of the process/thread heap and will not be tracked in the JVM Heap and have to be accounted for separately.
If you have a Linux or Solaris box, you can run a load test and try using Auptyma's Java Application Monitor. It will tell you the amount of space used in Java heap and even break it down by different types of objects. If you want a more detailed hierarchy then you can use the advanced heap analysis features to generate a map of object reachability within the JVM.
JXInsight comes with object allocation metrics (bytes) at a JVM, trace, transaction or method invocation level. Because we only record memory alloc sizes for the Java objects the overhead is significantly less than normal profiling tools capturing thread and call stack traces as well as tracking each individual object.
JXInsight also comes with a JVM metric analysis mode for timed test runs.
More Information on Memory Capacity Planning:
Other Java/J*EE Performance Insight Articles:
JXInsight Product Architect
"J*EE tuning, testing and tracing with JXInsight"