dincer.unal
dincer.unal

Reputation: 173

How to run two or more apps in same jvm

My middleware application it enables applications to run and share data. I have to run a lot of java applications. (maybe 180 desktop apps in same machine -- UI and data process apps.) When I run applications in different jvm, I have memory problems JVM welded. So that I want to try to run under the same JVM or ui and data process applications to group and run under the same JVM. Is it possible ?

Operating system is CentOS7 and applications are java 1.8.

Upvotes: 0

Views: 1081

Answers (1)

Karol Dowbecki
Karol Dowbecki

Reputation: 44980

No unless your applications are already designed to coexist e.g. by being packaged as something that can deployed to shared runtime platform. Otherwise you will have to rewrite all the applications to allow them to coexist (resolve classpath collisions, ensure static state is not a problem, other...) and have a shared entry point (e.g. single public static void main(String[]) method to start all of them) they won't be able to run on the same JVM instance.

Your best bet is probably to review memory consumption of separate JVM instance and tune the startup parameters to reduce it.

Upvotes: 1

Related Questions