wood burning stoves 2.0*
The moose likes Other JSE/JEE APIs and the fly likes Multiple calls jvm through JNI result in massave memory usage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Multiple calls jvm through JNI result in massave memory usage" Watch "Multiple calls jvm through JNI result in massave memory usage" New topic
Author

Multiple calls jvm through JNI result in massave memory usage

Mike Bouska
Greenhorn

Joined: Oct 15, 2012
Posts: 1
Hi,
I have a java program that is distributed through a jar file that can be run by itself, or is wrapped by a C++wrapper to be a windows service. The C++ code does next to nothing, it just takes the arguments sent in and calls the jvm.dll to launch the jar file passing in the options. The Java jar does all the actual work.
We support multi threading my launching multiple services/jar files.
Running multiple jar files through the command line works as expected, with each process having the same memory footprint and working the same.
When I run them as windows services, I get two different results based on how Ii start them.
if I start each service and wait till it is completely started before starting the next service, I see normal memory consumption.
if I start them as fast as I can, like how it normally would happen when starting up a machine, then memory consumption is much larger, I am seeing 5X the memory used. 300MB vs 1.5 GB. I can recreate this on windows 7, server 2003, and server 2008 so it does not appear to be anything with a particular system. I can't recreate this using the jar file alone. I have tried passing in a number of parameters to java to limit memory or force garbage collection as I think it is the memory that is being allocated to the jvm process that is the culprit as this only happens when the jvm is launching the process all at the same time, but have not found anything to get the memory allocation to be normal size. Does anyone have any idea what could be causing this? I have played around with a number of memory tools and search for a cause/fix for this online, but have not found anything similar to this.
thanks,
Mike
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple calls jvm through JNI result in massave memory usage
 
Similar Threads
Hibernate Transactions
passing args into a running java application
Private JVM & misc
RSA 7 Start Server
Deploying Jar inside WebSphere5