- This topic has 14 replies, 8 voices, and was last updated 18 years, 4 months ago by Riyad Kalla.
-
AuthorPosts
-
Bob EdmonstonMemberI have the new version of MyEclipse working with my WebLogic app (good news) 🙂 . The bad news is I get an OutOfMemoryError after just a few requests to the application 🙁
I tried setting the VM size for the JDK under windows->preferences->myeclpise->appsevers-weblogic7->JDK->Optional Java VM args
Here I added “-Xms512m -Xmx1024m”, but I still am getting this darn OutOfMemoryError. Any way to tell what the VM thinks it’s set to or any other way to set the max and min vm heap size?
Thanks!
Scott AndersonParticipantFirst, is the out of memory error coming from the WebLogic VM or the one Eclipse is running in? Eclipse itself can run out of memory if you have a lot of projects loaded up into it.
If Eclipse itself is running out of memory, you can increase it by adding the following flags to the Eclipse launch alias you’re using:
-vmargs -Xmx256MIf WebLogic is running out of memory, you’ve taken the correct approach. I’d suggest launching your application and then logging on with the WebLogic console and setting the logging level to ‘Info’. Then, shutdown and restart WebLogic. This will cause WebLogic to echo all of its configuration information to the console so that you can see if anything looks like a problem.
–Scott
MyEclipse Support
naga_iyerMemberHi,
Increasing the heap size wont necessarily solve memory issues. The greater the heap size, the greater the time it will take for garbage collection.. This will slow down the application server performance..
Hence, greater heap size may not be the correct approach to solve memory issues. Here’s a list of steps I follow to tune applications.. hope this helps!
-Naga1. Determine the kind of j2ee application you are deploying..if it has a lot of JSP pages, then you must increase the permanent memory size.
This is done by setting the param:-XX:MaxPermSize=64Mif you are trying to run/debug JSP applications (for eg. weblogic portal) set -Xms equal to -Xmx equal to -XX:MaxPermSize
for eg: -Xms128M -Xmx128M -XX:MaxPermSize=128M2. run hprof to monitor the memory usage. then based on this, allocate memory for new generation, eden and survior spaces.
Shown below is a typical configuration with old gen/new gen JVM memory.-Xms and -Xmx is set to the same value to clearly define the boundaries.
then allocate 25% of memory for perm mory. this is used by core java classes. in the remaining 192 M, this configuration gives 2 parts for old generation and 1 part for new generation(creation of new objects) + survivor spaces. You must then fine tune the survivor ratio based on hprof results. I think 8 is the default survivor ratio value for windows.-Xms256M -Xmx256M -XX:MaxPermSize=64M -XX:NewSize=64M -XX:MaxNewSize=64M -XX:SurvivorRatio=8
Scott AndersonParticipantNow that really tells you how to tune memory usage. I think I’ve learned something here myself today! 🙂
Thanks for taking the time to post a thorough treatment of the topic.
–Scott
MyEclipse Support
Bob EdmonstonMemberThese suggestions seemed to have worked. No more OutOfMemoryErrors! Thank you both.
Scott AndersonParticipantYou’re certainly welcome, but I think the best response was naga_iyer’s.
–Scott
MyEclipse Support
johnMemberbedmonston,
Could you say something about what settings you actually played with and what you settled on to eliminate your problem?
-john.
everZMemberHi, Scott:
I have the same problem:java.lang.OutOfMemoryError, but I am not using any servers yet. So I believe the error coming from Eclipse. Following is your answer to a similar question:
“If Eclipse itself is running out of memory, you can increase it by adding the following flags to the Eclipse launch alias you’re using:
-vmargs -Xmx256M”. Now where (what) is Eclipse launch alias? Someone also mentioned how to increase memory: “In the Window –> Preferences –> MyEclipse, I added the entry for setting heap size as -Xms256m -Xmx256m. ” Why I can not find a node from the above path to set heap size?Thanks.
Best,Everett
Riyad KallaMemberEverett,
There is no configuration node for heap size, those are command line arguments you pass to Eclipse when you run it, or addd it to your shortcut:eclipse.exe -vmargs -Xmx256m
for example.
everZMemberThank you, Riyad:
I launched Eclipse with eclipse.exe -vmargs -Xmx256m. Then in eclipse, I use Run–>Run as–> Java Application. I still got java.lang.OutOfMemoryError. I also tried -Xmx512m. Same error. I know it works, if I run the application with command line. Any thoughts?
Thanks.
Everett
Riyad KallaMemberAhh everett, if your app that you are trying to run is running out of mem, that is different. You need to edit your java command line args for that launch configuration and include the -Xmx512m.
1) Click Run > Run…
2) Find your launch config
3) Switch to Arguments tab
4) Type “-Xmx512m” into the “VM Arguments:” box
5) Hit Apply
6) Hit RunViola!
everZMemberThank you, Riyad:
It works.
Everett
dearmiteMemberoh,study it
PatFlaniganMemberI’m running out of memory in Eclipse. I’d like to set the vmargs higher for it. However I’m running on Mac OS X. I had the MyEclipse install set up the alias in the dock. But I don’t see where to change the settings from the default.
Riyad KallaMemberPat,
I had to hunt around on my mac for this too. You need to find the Eclipse executable, then right click and “Show Contents”, then drill down to either the MacOS folder or Contents folder IIRC, you will find an eclipse.ini file in there somewhere, you can edit that. -
AuthorPosts