• Post Reply Bookmark Topic Watch Topic
  • New Topic

Issues when running multiple apps on same JRE?

 
Matt Senecal
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've created an application that launches other Java applications, all running on the same JRE. I've noticed that this results in significant memory savings (60% or more). Performance doesn't seem to be measurably affected, but I've never run more than 4 applications at the same time.
Does anyone know of any performance issues in situations like this? JRE limitations? Any information would be appreciated.
 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It will be more efficent because:
You can share classes, including all standra java classes e.g. java.io.* You don't need to load these classes in different JVMs. This means less memory usage on your PC and faster loading times.
When you need more heap space, a single memory request to the OS is done, instead of multiple JVMs all doing requests. This also means you'll probably have less wasted memory.
It may be less efficient because:
The heap space is now bigger. Garbage collection through the heap will take longer. Also the GC may think int values of one app point to memory used by a different app. How much, if any, effect this will have depends on the memory usage of your applications, and the way your garbage collector works.
If your applications do heavy computations, they may compete for reasources, because they all urn in the same JVM, and not seperate JVMs. This is questionable. it really depends on how your OS treats a JVM in terms of feeding it resources, and how demanding your applications are.

--Mark
 
Scott Palmer
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also the GC may think int values of one app point to memory used by a different app.

How would the GC treat this any different than getting confused about object references and int values within a single app?
Scanning the heap wil the GC have any knowledge of one app vs the other? I don't think so, but as you say it would depend on the collector.
 
Matt Senecal
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
Originally posted by Mark Herschberg:
It will be more efficent because:
You can share classes, including all standra java classes e.g. java.io.* You don't need to load these classes in different JVMs. This means less memory usage on your PC and faster loading times.
When you need more heap space, a single memory request to the OS is done, instead of multiple JVMs all doing requests. This also means you'll probably have less wasted memory.
It may be less efficient because:
The heap space is now bigger. Garbage collection through the heap will take longer. Also the GC may think int values of one app point to memory used by a different app. How much, if any, effect this will have depends on the memory usage of your applications, and the way your garbage collector works.
If your applications do heavy computations, they may compete for reasources, because they all urn in the same JVM, and not seperate JVMs. This is questionable. it really depends on how your OS treats a JVM in terms of feeding it resources, and how demanding your applications are.

--Mark

 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Scott Palmer:
How would the GC treat this any different than getting confused about object references and int values within a single app?

Well, it's marginal. I'm just thinking that with 4 apps in one JVM your memort is 4 times as big (yes, very rough approximation). Maybe JVMs are smart enough that when they have "big ints" they check if the int value is within the memory range (as opposed to just saying, oh, it's >1000, so assume it's memory). If they do this, then having a larger space means more large numbers will fall within the range. But yeah, the effect is probably minimal.

--Mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!