Solved

eclipse server separate jvm

Posted on 2014-02-19
4
419 Views
Last Modified: 2014-02-26
How and who allocate memory to JVM.
When the JVM starts ? is it at the start of the eclipse or is it start of the web or application server like tomcat/weblogic etc within the eclipse.
Is there is separate jvm for eclipse and web or application server?


Within eclipse when i  include and start up a webserver, like Apache Tomcat is  there is a  sepatate JVM for the web server/application server. Does the memory allocated to that specific separate JVM may need to be adjusted for this specific situation inside eclipse.init .

At any moment how to find out which JVM is using how much memory. Is there is a posibility that specific jvm can use less than Initial Memory?

please advise
Any links resources ideas highly appreciated. Thanks in advance
0
Comment
Question by:gudii9
  • 2
  • 2
4 Comments
 
LVL 19

Expert Comment

by:Ken Butters
ID: 39871756
How and who allocate memory to JVM.
The memory is allocated to the JVM when the JVM starts up.  The JVM starts up when you execute "java.exe".

In eclipse... if you don't specify any VMargs to override it... the amount of initial and the amount of max memory allocated to the JVM heap is defined by the eclipse.ini file.

When you are running a Java Application you can set your JVM's in the run configuration for that app.

When you are running a web server you can set the JVM arguments in that web server.
Here is an example of setting the Heap size for a tomcat server.
http://viralpatel.net/blogs/setting-tomcat-heap-size-jvm-heap-eclipse/


When the JVM starts ? is it at the start of the eclipse or is it start of the web or application server like tomcat/weblogic etc within the eclipse.
Is there is separate jvm for eclipse and web or application server?
Yes when the JVM starts according to whatever arguments are sent to java.exe.  
Those arguments can be determined by eclipse.ini or overridden for a specific application by adding JVM arg as specified in answer to prior question.


Within eclipse when i  include and start up a webserver, like Apache Tomcat is  there is a  sepatate JVM for the web server/application server. Does the memory allocated to that specific separate JVM may need to be adjusted for this specific situation inside eclipse.init .
There is one JVM that is started.  if you are running a webserver, the webserver will start an instance of the JVM by executing java.exe.

You need to worry about adding more memory if your application is getting out of memory errors. (unless your application is not working correctly).


At any moment how to find out which JVM is using how much memory. Is there is a posibility that specific jvm can use less than Initial Memory?

I haven't used it myself, but JConsole can show you how much memory the JVM is using.  Here is some documentation on it.
http://docs.oracle.com/javase/6/docs/technotes/guides/management/jconsole.html
0
 
LVL 7

Author Comment

by:gudii9
ID: 39881004
when i tried to launch on tomcat 6 instead of  i got error as below

Tomcat version 6.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 Web modules

Please advise on how to fix
0
 
LVL 7

Author Comment

by:gudii9
ID: 39881480
I used tomcat 7 and went to the Arguments as given in link
http://viralpatel.net/blogs/setting-tomcat-heap-size-jvm-heap-eclipse/

what is the optimal value i should give there.

The link gave valie
-Xms 64 -Xmx254

Please advise
0
 
LVL 19

Accepted Solution

by:
Ken Butters earned 500 total points
ID: 39881642
The optimal value for heap allocation will vary from project to project.  

In order to find out what memory would be optimal for your project you would have to do some profiling of your app.

I've never done that myself... but did find some links that might be of interest:

0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This video teaches viewers about errors in exception handling.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now