You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by DRS2 Usenet <DR...@sengsational.com> on 2008/12/03 04:04:23 UTC

Out of memory during second publish - reproduced

I had already installed jdk1.6.0_06
I had already installed Geronimo: geronimo-tomcat6-javaee5-2.1.3-bin.zip
I installed a fresh Ganymede: eclipse-jee-ganymede-SR1-win32.zip
Added Geronimo 2.1 plugins from within Eclipse.
Then I deployed a web application.  The first time, it deploys fine.  
The second time, I get an out of memory, due to heap space.

The web application may be found here: 
http://www.manning.com/dbrown/SampleApplication.zip

1) Download the source code from above, and unzip.
2) copy Struts2InAction.war to Struts2InAction.zip
3) Unzip the Struts2InAction.zip file to a folder called WebContent and 
delete Struts2InAction.zip
4) Validate that your WebContent has WEB-INF, index.html, etc.
5) In your Eclipse workspace folder, create a folder called 
Struts2InAction, and move your WebContent folder into it.
6) Start Eclipse
7) Right-click in Project Explorer, New > Project > Web > Dynamic Web 
Project (next)
8) Project name: Struts2InAction > select Geronimo 2.1 > (next)
9) Leave Context Root and Content Directory, but change Java Source 
Directory to WebContent/WEB-INF/src > (finish)
10) Right-click your project > Run As > Run On Server
11) Point browser at http://localhost:8080/Struts2InAction 
<http://localhost:8080/HelloWorld>
12) index.html will say "one moment please" while the jsp compiles, then 
the menu will come-up.
13) Back in Eclipse, edit (for example) WEB-INF/applicationContext.xml 
with your MySql login and save the file.
14) Wait for the application to republish itself.

This is where the error occurs:

Deployment failed due to java.lang.OutOfMemoryError: Java heap space

I've started Eclipse with -vmargs -Xmx768M and get the same result. Not 
able to put 1024M in there, for some reason (Eclipse won't even start).

--Dale--

Re: Out of memory during second publish - reproduced

Posted by Kevan Miller <ke...@gmail.com>.
On Dec 4, 2008, at 11:03 AM, Dale wrote:

> Thanks Jeff.
> I added -Xmx768M to the end of the existing entry found at:
>
> Run > Run Configurations >  (Geronimo 2.1) >  Arguments > VM Arguments
>
> I started the server right from the run configuration because it  
> seemed
> like my -Xmx768M would disappear if I didn't.
>
> It published the second time without error!  I thought I was home- 
> free,
> but the third publish, I got a different error:
>
> Connection to deployment manager failed. See log for details.  
> Invalid login.
>
> So I tried it all again (many times actually).
>
> I restarted Eclipse, and got the two good publishes, although the
> second publish I got this warning:
>
> 10:41:20,968 WARN  [ResolverUtil] Could not examine class 'manning/ 
> chapterFour/utils/User.class' due to a java.lang.OutOfMemoryError  
> with message: PermGen space
>
> It was just a warning, so the application publish did not
> fail.  I removed the project from the server an published
> a third time.  This time, the published failed with
>
> 10:43:49,250 ERROR [Deployer] Deployment failed due to  
> java.lang.OutOfMemoryError: PermGen space
>
> I'm starting Eclipse with "-vmargs -Xmx768M", if that factors into it.
> I was unable to change the memory configuration in eclipse.ini without
> Eclipse failing to startup, so eclipse.ini contains default settings.

If you're running out of PermGen space, you'll want to bump up your  
max perm gen size.:

-XX:MaxPermSize=256m

There may be a problem (there's an active discussion on our user  
list). However, it's just as likely that you need to bump your max  
permgen setting. Two deploys is too little to make any conclusions.

--kevan


Re: Out of memory during second publish - reproduced

Posted by Dale <da...@sengsational.com>.
Thanks Jeff. 

I added -Xmx768M to the end of the existing entry found at:

Run > Run Configurations >  (Geronimo 2.1) >  Arguments > VM Arguments

I started the server right from the run configuration because it seemed
like my -Xmx768M would disappear if I didn't.

It published the second time without error!  I thought I was home-free,
but the third publish, I got a different error:

Connection to deployment manager failed. 
See log for details. Invalid login.

So I tried it all again (many times actually).

I restarted Eclipse, and got the two good publishes, although the
second publish I got this warning:

10:41:20,968 WARN  [ResolverUtil] Could not examine class 
'manning/chapterFour/utils/User.class' due to a 
java.lang.OutOfMemoryError with message: PermGen space

It was just a warning, so the application publish did not
fail.  I removed the project from the server an published
a third time.  This time, the published failed with

10:43:49,250 ERROR [Deployer] Deployment failed due to 
java.lang.OutOfMemoryError: PermGen space

I'm starting Eclipse with "-vmargs -Xmx768M", if that factors into it.
I was unable to change the memory configuration in eclipse.ini without
Eclipse failing to startup, so eclipse.ini contains default settings.

As an additional test, I removed what looked to be the problem,
chapterFour.util, from the project and restarted Eclipse.
After restarting the server from the run configuration with -Xmx768M,
the first publish worked, the second failed with:

Starting of module failed.  See log for details.
  start of default/Struts2InAction/1.0/car failed
  org.apache.geronimo.kernel.config.LifecycleException: start of 
default/Struts2InAction/1.0/car failed

So, the more I play with this, the more different error messages I
seem to be able to expose.

I can work around it by restarting Eclipse for every publish, but that's 
quite a pain. 

Looking for more ideas, I suppose.

--Dale--

RunHua Chi on Tue, 02 Dec 2008 20:38:55 -0800 wrote:

> Changing the eclipse.ini vmargs changes the heap size to run Eclipse, while
> for your application, you might need to change heap size from "Run
> configuration".
>
> Jeff Chi

>>DRS2 Usenet wrote:
(snip)
>> 14) Wait for the application to republish itself.
>> 
>> This is where the error occurs:
>> 
>> Deployment failed due to java.lang.OutOfMemoryError: Java heap space
>> 
>> I've started Eclipse with -vmargs -Xmx768M and get the same result. Not 
>> able to put 1024M in there, for some reason (Eclipse won't even start).



Re: Out of memory during second publish - reproduced

Posted by Tim McConnell <ti...@gmail.com>.
Hi Dale, Thanks for the zipfile. I'll see if I can reproduce.....

DRS2 Usenet wrote:
> I had already installed jdk1.6.0_06
> I had already installed Geronimo: geronimo-tomcat6-javaee5-2.1.3-bin.zip
> I installed a fresh Ganymede: eclipse-jee-ganymede-SR1-win32.zip
> Added Geronimo 2.1 plugins from within Eclipse.
> Then I deployed a web application.  The first time, it deploys fine.  
> The second time, I get an out of memory, due to heap space.
> 
> The web application may be found here: 
> http://www.manning.com/dbrown/SampleApplication.zip
> 
> 1) Download the source code from above, and unzip.
> 2) copy Struts2InAction.war to Struts2InAction.zip
> 3) Unzip the Struts2InAction.zip file to a folder called WebContent and 
> delete Struts2InAction.zip
> 4) Validate that your WebContent has WEB-INF, index.html, etc.
> 5) In your Eclipse workspace folder, create a folder called 
> Struts2InAction, and move your WebContent folder into it.
> 6) Start Eclipse
> 7) Right-click in Project Explorer, New > Project > Web > Dynamic Web 
> Project (next)
> 8) Project name: Struts2InAction > select Geronimo 2.1 > (next)
> 9) Leave Context Root and Content Directory, but change Java Source 
> Directory to WebContent/WEB-INF/src > (finish)
> 10) Right-click your project > Run As > Run On Server
> 11) Point browser at http://localhost:8080/Struts2InAction 
> <http://localhost:8080/HelloWorld>
> 12) index.html will say "one moment please" while the jsp compiles, then 
> the menu will come-up.
> 13) Back in Eclipse, edit (for example) WEB-INF/applicationContext.xml 
> with your MySql login and save the file.
> 14) Wait for the application to republish itself.
> 
> This is where the error occurs:
> 
> Deployment failed due to java.lang.OutOfMemoryError: Java heap space
> 
> I've started Eclipse with -vmargs -Xmx768M and get the same result. Not 
> able to put 1024M in there, for some reason (Eclipse won't even start).
> 
> --Dale--
> 

Re: [geronimo] Re: Out of memory during second publish - reproduced & Fixed

Posted by "Steve H." <st...@sjlt.co.uk>.
Tim,

I tried deploying directly to Geronimo as you advised. I found I could
republish multiple times if Geronimo had been started directly and not by
Eclipse. This led me to carefully examining the ps traces running outside
eclipse and under eclipse.

By moving the JVM parameters to the start of the Eclipse input box I solved
the problem. I think the problem was that I had inserted these parameters
immediately before the closing ". I think these parameters were not getting
through to the JVM invocation.

Thanks for your help,

Steve


Steve H. wrote:
> 
> Hi Tim,
> 
> Thanks for responding so promptly.
> 
> I have followed your advice although I set MaxPermSize to 512m for eclipse
> and Geronimo. These settings can be seen in the ps output I posted.
> 
> The artifact I am developing is an experimental EAR. It includes 3 jsp's
> but it includes Hibernate POJO's, EJB3 session beans and a Struts
> presentation layer.
> 
> The EAR deploys and runs fine under Eclipse. However it generally fails
> with a PermGen Space error on the 2nd deployment. Not so good for
> development. I am running on a laptop however it has 2 GB RAM.
> 
> Please email me your address and I will send you the EAR. However this
> might not be for a couple of weeks. as I'm just going on holiday. I will
> send you my email address separately.
> 
> Many thanks for your help,
> 
> Steve
> 
> 
> Tim McConnell wrote:
>> 
>> Hi Steve, I assume you've gone through the 5 steps I outlined previously
>> for 
>> Dale. You might try increasing you MaxPermsize to 768mb but I doubt
>> that'll make 
>> much difference. Are you able to deploy the artifact to Geronimo outside
>> of 
>> Eclipse (e.g., using the Admin console) ?? Finally, would you be able to
>> send me 
>> the artifact that you're deploying ?? If it's proprietary and you cannot
>> I fully 
>> understand. If not, could you briefly describe the artifact that you are 
>> deploying (i.e., EAR, WAR, EJB, etc.) ??
>> 
>> Steve H. wrote:
>>> I'm getting this error consistently after increasing the memory
>>> allocation
>>> for Eclipse and Geronimo.
>>> 
>>> I'm running on OpenSUSE 10.3 x64 with Geronimo 2.1.3 on a machine with
>>> 2GB
>>> RAM.
>>> 
>>> Output from 'ps aux | grep java' and Eclipse error trace shown below: -
>>> 
>>> Output of 'ps aux | grep java' following PermGen crash in Geronimo.
>>> 
>>> steve     4325 17.9 18.6 1474804 383908 ?      Sl   23:43   1:38
>>> /usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/jre/bin/java -Xmx512m
>>> -XX:MaxPermSize=512m -jar
>>> /usr/share/eclipse/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
>>> -os linux -ws gtk -arch x86_64 -showsplash -launcher
>>> /usr/share/eclipse/eclipse -name Eclipse --launcher.library
>>> /usr/share/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.0.101.R34x_v20080731/eclipse_1115.so
>>> -startup
>>> /usr/share/eclipse/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
>>> -exitdata 160002 -vm /usr/bin/java -vmargs -Xmx512m -XX:MaxPermSize=512m
>>> -jar
>>> /usr/share/eclipse/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
>>> steve     4835 27.1 14.8 518960 305744 ?       Sl   23:44   2:13
>>> /usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/bin/java
>>> -javaagent:/usr/local/geronimo-tomcat6-javaee5-2.1.3/bin/jpa.jar
>>> -Djava.ext.dirs=/usr/local/geronimo-tomcat6-javaee5-2.1.3/lib/ext:/usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/jre/lib/ext
>>> -Djava.endorsed.dirs=/usr/local/geronimo-tomcat6-javaee5-2.1.3/lib/endorsed:/usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/jre/lib/endorsed
>>> -Xmx512m -XX:MaxPermSize=512m -Dfile.encoding=UTF-8 -classpath
>>> /usr/local/geronimo-tomcat6-javaee5-2.1.3/bin/server.jar
>>> org.apache.geronimo.cli.daemon.DaemonCLI --long
>>> steve    10155  0.0  0.0   5120   788 pts/1    R+   23:52   0:00 grep
>>> java
>>> 
>>> Trace from Eclipse
>>> 
>>> 23:51:10,653 WARN  [Settings] Settings: Could not parse struts.locale
>>> setting, substituting default VM locale
>>> 23:51:31,757 ERROR [[jsp]] Servlet.service() for servlet jsp threw
>>> exception
>>> java.lang.OutOfMemoryError: PermGen space
>>> 	at java.lang.ClassLoader.defineClass1(Native Method)
>>> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>>> 	at
>>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>>> 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>>> etc...
>>> 
>>> Output show below: -
>>> 
>>> Tim McConnell wrote:
>>>>
>>>> That's wonderful Dale !! Please let me know if you have any other
>>>> problems. BTW, 
>>>> I've open the following JIRA to fix similar problems.....
>>>>
>>>> -----> https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-543
>>>>
>>>> DRS2 Usenet wrote:
>>>>> Tim McConnell wrote:
>>>>>
>>>>> (snip)
>>>>>> 4.  Page down in that section and append your VM arguments at the end 
>>>>>> -- don't delete those that are already there. I used the same ones 
>>>>>> that Kevan used, but I'm using Java 1.5 and I see that you're using 
>>>>>> Java 1.6:
>>>>>>
>>>>>>     -Xmx512m -XX:MaxPermSize=256m
>>>>> (snip)
>>>>>> Please try this and let me know what happens. I think you'll have 
>>>>>> better results now. Meanwhile, I'm going to open a GEP JIRA to 
>>>>>> investigate if we can programmatically determine and set the Geronimo 
>>>>>> server VM arguments using those already established for Eclipse since 
>>>>>> obviously the default values for the server are not always
>>>>>> sufficient. 
>>>>>> Thanks much.
>>>>> Thanks Tim, That worked great.  I'd been using "run configurations" to 
>>>>> make the Geronimo JVM settings... never tried double clicking on the 
>>>>> server.  I've been able to republish many times without error AND 
>>>>> without restarting the server (this is really a NICE feature!).
>>>>>>
>>>>>> Tim McConnell wrote:
>>>>>>> Hi Dale, just a quick note to tell you that I can now reproduce your 
>>>>>>> failure. Looking for a resolution, and will let you know what I find 
>>>>>>> out.....
>>>>>>>
>>>>>>> DRS2 Usenet wrote:
>>>>>>>> I had already installed jdk1.6.0_06
>>>>>>>> I had already installed Geronimo: 
>>>>>>>> geronimo-tomcat6-javaee5-2.1.3-bin.zip
>>>>>>>> I installed a fresh Ganymede: eclipse-jee-ganymede-SR1-win32.zip
>>>>>>>> Added Geronimo 2.1 plugins from within Eclipse.
>>>>>>>> Then I deployed a web application.  The first time, it deploys 
>>>>>>>> fine.  The second time, I get an out of memory, due to heap space.
>>>>>>>>
>>>>>>>> The web application may be found here: 
>>>>>>>> http://www.manning.com/dbrown/SampleApplication.zip
>>>>>>>>
>>>>>>>> 1) Download the source code from above, and unzip.
>>>>>>>> 2) copy Struts2InAction.war to Struts2InAction.zip
>>>>>>>> 3) Unzip the Struts2InAction.zip file to a folder called WebContent 
>>>>>>>> and delete Struts2InAction.zip
>>>>>>>> 4) Validate that your WebContent has WEB-INF, index.html, etc.
>>>>>>>> 5) In your Eclipse workspace folder, create a folder called 
>>>>>>>> Struts2InAction, and move your WebContent folder into it.
>>>>>>>> 6) Start Eclipse
>>>>>>>> 7) Right-click in Project Explorer, New > Project > Web > Dynamic 
>>>>>>>> Web Project (next)
>>>>>>>> 8) Project name: Struts2InAction > select Geronimo 2.1 > (next)
>>>>>>>> 9) Leave Context Root and Content Directory, but change Java Source 
>>>>>>>> Directory to WebContent/WEB-INF/src > (finish)
>>>>>>>> 10) Right-click your project > Run As > Run On Server
>>>>>>>> 11) Point browser at http://localhost:8080/Struts2InAction 
>>>>>>>> <http://localhost:8080/HelloWorld>
>>>>>>>> 12) index.html will say "one moment please" while the jsp compiles, 
>>>>>>>> then the menu will come-up.
>>>>>>>> 13) Back in Eclipse, edit (for example) 
>>>>>>>> WEB-INF/applicationContext.xml with your MySql login and save the
>>>>>>>> file.
>>>>>>>> 14) Wait for the application to republish itself.
>>>>>>>>
>>>>>>>> This is where the error occurs:
>>>>>>>>
>>>>>>>> Deployment failed due to java.lang.OutOfMemoryError: Java heap
>>>>>>>> space
>>>>>>>>
>>>>>>>> I've started Eclipse with -vmargs -Xmx768M and get the same result. 
>>>>>>>> Not able to put 1024M in there, for some reason (Eclipse won't even 
>>>>>>>> start).
>>>>>>>>
>>>>>>>> --Dale--
>>>>>>>>
>>>>>
>>>>
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Out-of-memory-during-second-publish---reproduced-tp20805951s134p21278441.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: [geronimo] Re: Out of memory during second publish - reproduced

Posted by "Steve H." <st...@sjlt.co.uk>.
Hi Tim,

Thanks for responding so promptly.

I have followed your advice although I set MaxPermSize to 512m for eclipse
and Geronimo. These settings can be seen in the ps output I posted.

The artifact I am developing is an experimental EAR. It includes 3 jsp's but
it includes Hibernate POJO's, EJB3 session beans and a Struts presentation
layer.

The EAR deploys and runs fine under Eclipse. However it generally fails with
a PermGen Space error on the 2nd deployment. Not so good for development. I
am running on a laptop however it has 2 GB RAM.

Please email me your address and I will send you the EAR. However this might
not be for a couple of weeks. as I'm just going on holiday. I will send you
my email address separately.

Many thanks for your help,

Steve


Tim McConnell wrote:
> 
> Hi Steve, I assume you've gone through the 5 steps I outlined previously
> for 
> Dale. You might try increasing you MaxPermsize to 768mb but I doubt
> that'll make 
> much difference. Are you able to deploy the artifact to Geronimo outside
> of 
> Eclipse (e.g., using the Admin console) ?? Finally, would you be able to
> send me 
> the artifact that you're deploying ?? If it's proprietary and you cannot I
> fully 
> understand. If not, could you briefly describe the artifact that you are 
> deploying (i.e., EAR, WAR, EJB, etc.) ??
> 
> Steve H. wrote:
>> I'm getting this error consistently after increasing the memory
>> allocation
>> for Eclipse and Geronimo.
>> 
>> I'm running on OpenSUSE 10.3 x64 with Geronimo 2.1.3 on a machine with
>> 2GB
>> RAM.
>> 
>> Output from 'ps aux | grep java' and Eclipse error trace shown below: -
>> 
>> Output of 'ps aux | grep java' following PermGen crash in Geronimo.
>> 
>> steve     4325 17.9 18.6 1474804 383908 ?      Sl   23:43   1:38
>> /usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/jre/bin/java -Xmx512m
>> -XX:MaxPermSize=512m -jar
>> /usr/share/eclipse/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
>> -os linux -ws gtk -arch x86_64 -showsplash -launcher
>> /usr/share/eclipse/eclipse -name Eclipse --launcher.library
>> /usr/share/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.0.101.R34x_v20080731/eclipse_1115.so
>> -startup
>> /usr/share/eclipse/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
>> -exitdata 160002 -vm /usr/bin/java -vmargs -Xmx512m -XX:MaxPermSize=512m
>> -jar
>> /usr/share/eclipse/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
>> steve     4835 27.1 14.8 518960 305744 ?       Sl   23:44   2:13
>> /usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/bin/java
>> -javaagent:/usr/local/geronimo-tomcat6-javaee5-2.1.3/bin/jpa.jar
>> -Djava.ext.dirs=/usr/local/geronimo-tomcat6-javaee5-2.1.3/lib/ext:/usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/jre/lib/ext
>> -Djava.endorsed.dirs=/usr/local/geronimo-tomcat6-javaee5-2.1.3/lib/endorsed:/usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/jre/lib/endorsed
>> -Xmx512m -XX:MaxPermSize=512m -Dfile.encoding=UTF-8 -classpath
>> /usr/local/geronimo-tomcat6-javaee5-2.1.3/bin/server.jar
>> org.apache.geronimo.cli.daemon.DaemonCLI --long
>> steve    10155  0.0  0.0   5120   788 pts/1    R+   23:52   0:00 grep
>> java
>> 
>> Trace from Eclipse
>> 
>> 23:51:10,653 WARN  [Settings] Settings: Could not parse struts.locale
>> setting, substituting default VM locale
>> 23:51:31,757 ERROR [[jsp]] Servlet.service() for servlet jsp threw
>> exception
>> java.lang.OutOfMemoryError: PermGen space
>> 	at java.lang.ClassLoader.defineClass1(Native Method)
>> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>> 	at
>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>> 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>> etc...
>> 
>> Output show below: -
>> 
>> Tim McConnell wrote:
>>>
>>> That's wonderful Dale !! Please let me know if you have any other
>>> problems. BTW, 
>>> I've open the following JIRA to fix similar problems.....
>>>
>>> -----> https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-543
>>>
>>> DRS2 Usenet wrote:
>>>> Tim McConnell wrote:
>>>>
>>>> (snip)
>>>>> 4.  Page down in that section and append your VM arguments at the end 
>>>>> -- don't delete those that are already there. I used the same ones 
>>>>> that Kevan used, but I'm using Java 1.5 and I see that you're using 
>>>>> Java 1.6:
>>>>>
>>>>>     -Xmx512m -XX:MaxPermSize=256m
>>>> (snip)
>>>>> Please try this and let me know what happens. I think you'll have 
>>>>> better results now. Meanwhile, I'm going to open a GEP JIRA to 
>>>>> investigate if we can programmatically determine and set the Geronimo 
>>>>> server VM arguments using those already established for Eclipse since 
>>>>> obviously the default values for the server are not always sufficient. 
>>>>> Thanks much.
>>>> Thanks Tim, That worked great.  I'd been using "run configurations" to 
>>>> make the Geronimo JVM settings... never tried double clicking on the 
>>>> server.  I've been able to republish many times without error AND 
>>>> without restarting the server (this is really a NICE feature!).
>>>>>
>>>>> Tim McConnell wrote:
>>>>>> Hi Dale, just a quick note to tell you that I can now reproduce your 
>>>>>> failure. Looking for a resolution, and will let you know what I find 
>>>>>> out.....
>>>>>>
>>>>>> DRS2 Usenet wrote:
>>>>>>> I had already installed jdk1.6.0_06
>>>>>>> I had already installed Geronimo: 
>>>>>>> geronimo-tomcat6-javaee5-2.1.3-bin.zip
>>>>>>> I installed a fresh Ganymede: eclipse-jee-ganymede-SR1-win32.zip
>>>>>>> Added Geronimo 2.1 plugins from within Eclipse.
>>>>>>> Then I deployed a web application.  The first time, it deploys 
>>>>>>> fine.  The second time, I get an out of memory, due to heap space.
>>>>>>>
>>>>>>> The web application may be found here: 
>>>>>>> http://www.manning.com/dbrown/SampleApplication.zip
>>>>>>>
>>>>>>> 1) Download the source code from above, and unzip.
>>>>>>> 2) copy Struts2InAction.war to Struts2InAction.zip
>>>>>>> 3) Unzip the Struts2InAction.zip file to a folder called WebContent 
>>>>>>> and delete Struts2InAction.zip
>>>>>>> 4) Validate that your WebContent has WEB-INF, index.html, etc.
>>>>>>> 5) In your Eclipse workspace folder, create a folder called 
>>>>>>> Struts2InAction, and move your WebContent folder into it.
>>>>>>> 6) Start Eclipse
>>>>>>> 7) Right-click in Project Explorer, New > Project > Web > Dynamic 
>>>>>>> Web Project (next)
>>>>>>> 8) Project name: Struts2InAction > select Geronimo 2.1 > (next)
>>>>>>> 9) Leave Context Root and Content Directory, but change Java Source 
>>>>>>> Directory to WebContent/WEB-INF/src > (finish)
>>>>>>> 10) Right-click your project > Run As > Run On Server
>>>>>>> 11) Point browser at http://localhost:8080/Struts2InAction 
>>>>>>> <http://localhost:8080/HelloWorld>
>>>>>>> 12) index.html will say "one moment please" while the jsp compiles, 
>>>>>>> then the menu will come-up.
>>>>>>> 13) Back in Eclipse, edit (for example) 
>>>>>>> WEB-INF/applicationContext.xml with your MySql login and save the
>>>>>>> file.
>>>>>>> 14) Wait for the application to republish itself.
>>>>>>>
>>>>>>> This is where the error occurs:
>>>>>>>
>>>>>>> Deployment failed due to java.lang.OutOfMemoryError: Java heap space
>>>>>>>
>>>>>>> I've started Eclipse with -vmargs -Xmx768M and get the same result. 
>>>>>>> Not able to put 1024M in there, for some reason (Eclipse won't even 
>>>>>>> start).
>>>>>>>
>>>>>>> --Dale--
>>>>>>>
>>>>
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Out-of-memory-during-second-publish---reproduced-tp20805951s134p21196516.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: [geronimo] Re: Out of memory during second publish - reproduced

Posted by Tim McConnell <ti...@gmail.com>.
Hi Steve, I assume you've gone through the 5 steps I outlined previously for 
Dale. You might try increasing you MaxPermsize to 768mb but I doubt that'll make 
much difference. Are you able to deploy the artifact to Geronimo outside of 
Eclipse (e.g., using the Admin console) ?? Finally, would you be able to send me 
the artifact that you're deploying ?? If it's proprietary and you cannot I fully 
understand. If not, could you briefly describe the artifact that you are 
deploying (i.e., EAR, WAR, EJB, etc.) ??

Steve H. wrote:
> I'm getting this error consistently after increasing the memory allocation
> for Eclipse and Geronimo.
> 
> I'm running on OpenSUSE 10.3 x64 with Geronimo 2.1.3 on a machine with 2GB
> RAM.
> 
> Output from 'ps aux | grep java' and Eclipse error trace shown below: -
> 
> Output of 'ps aux | grep java' following PermGen crash in Geronimo.
> 
> steve     4325 17.9 18.6 1474804 383908 ?      Sl   23:43   1:38
> /usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/jre/bin/java -Xmx512m
> -XX:MaxPermSize=512m -jar
> /usr/share/eclipse/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
> -os linux -ws gtk -arch x86_64 -showsplash -launcher
> /usr/share/eclipse/eclipse -name Eclipse --launcher.library
> /usr/share/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.0.101.R34x_v20080731/eclipse_1115.so
> -startup
> /usr/share/eclipse/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
> -exitdata 160002 -vm /usr/bin/java -vmargs -Xmx512m -XX:MaxPermSize=512m
> -jar
> /usr/share/eclipse/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
> steve     4835 27.1 14.8 518960 305744 ?       Sl   23:44   2:13
> /usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/bin/java
> -javaagent:/usr/local/geronimo-tomcat6-javaee5-2.1.3/bin/jpa.jar
> -Djava.ext.dirs=/usr/local/geronimo-tomcat6-javaee5-2.1.3/lib/ext:/usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/jre/lib/ext
> -Djava.endorsed.dirs=/usr/local/geronimo-tomcat6-javaee5-2.1.3/lib/endorsed:/usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/jre/lib/endorsed
> -Xmx512m -XX:MaxPermSize=512m -Dfile.encoding=UTF-8 -classpath
> /usr/local/geronimo-tomcat6-javaee5-2.1.3/bin/server.jar
> org.apache.geronimo.cli.daemon.DaemonCLI --long
> steve    10155  0.0  0.0   5120   788 pts/1    R+   23:52   0:00 grep java
> 
> Trace from Eclipse
> 
> 23:51:10,653 WARN  [Settings] Settings: Could not parse struts.locale
> setting, substituting default VM locale
> 23:51:31,757 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
> java.lang.OutOfMemoryError: PermGen space
> 	at java.lang.ClassLoader.defineClass1(Native Method)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> 	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
> 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
> etc...
> 
> Output show below: -
> 
> Tim McConnell wrote:
>>
>> That's wonderful Dale !! Please let me know if you have any other
>> problems. BTW, 
>> I've open the following JIRA to fix similar problems.....
>>
>> -----> https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-543
>>
>> DRS2 Usenet wrote:
>>> Tim McConnell wrote:
>>>
>>> (snip)
>>>> 4.  Page down in that section and append your VM arguments at the end 
>>>> -- don't delete those that are already there. I used the same ones 
>>>> that Kevan used, but I'm using Java 1.5 and I see that you're using 
>>>> Java 1.6:
>>>>
>>>>     -Xmx512m -XX:MaxPermSize=256m
>>> (snip)
>>>> Please try this and let me know what happens. I think you'll have 
>>>> better results now. Meanwhile, I'm going to open a GEP JIRA to 
>>>> investigate if we can programmatically determine and set the Geronimo 
>>>> server VM arguments using those already established for Eclipse since 
>>>> obviously the default values for the server are not always sufficient. 
>>>> Thanks much.
>>> Thanks Tim, That worked great.  I'd been using "run configurations" to 
>>> make the Geronimo JVM settings... never tried double clicking on the 
>>> server.  I've been able to republish many times without error AND 
>>> without restarting the server (this is really a NICE feature!).
>>>>
>>>> Tim McConnell wrote:
>>>>> Hi Dale, just a quick note to tell you that I can now reproduce your 
>>>>> failure. Looking for a resolution, and will let you know what I find 
>>>>> out.....
>>>>>
>>>>> DRS2 Usenet wrote:
>>>>>> I had already installed jdk1.6.0_06
>>>>>> I had already installed Geronimo: 
>>>>>> geronimo-tomcat6-javaee5-2.1.3-bin.zip
>>>>>> I installed a fresh Ganymede: eclipse-jee-ganymede-SR1-win32.zip
>>>>>> Added Geronimo 2.1 plugins from within Eclipse.
>>>>>> Then I deployed a web application.  The first time, it deploys 
>>>>>> fine.  The second time, I get an out of memory, due to heap space.
>>>>>>
>>>>>> The web application may be found here: 
>>>>>> http://www.manning.com/dbrown/SampleApplication.zip
>>>>>>
>>>>>> 1) Download the source code from above, and unzip.
>>>>>> 2) copy Struts2InAction.war to Struts2InAction.zip
>>>>>> 3) Unzip the Struts2InAction.zip file to a folder called WebContent 
>>>>>> and delete Struts2InAction.zip
>>>>>> 4) Validate that your WebContent has WEB-INF, index.html, etc.
>>>>>> 5) In your Eclipse workspace folder, create a folder called 
>>>>>> Struts2InAction, and move your WebContent folder into it.
>>>>>> 6) Start Eclipse
>>>>>> 7) Right-click in Project Explorer, New > Project > Web > Dynamic 
>>>>>> Web Project (next)
>>>>>> 8) Project name: Struts2InAction > select Geronimo 2.1 > (next)
>>>>>> 9) Leave Context Root and Content Directory, but change Java Source 
>>>>>> Directory to WebContent/WEB-INF/src > (finish)
>>>>>> 10) Right-click your project > Run As > Run On Server
>>>>>> 11) Point browser at http://localhost:8080/Struts2InAction 
>>>>>> <http://localhost:8080/HelloWorld>
>>>>>> 12) index.html will say "one moment please" while the jsp compiles, 
>>>>>> then the menu will come-up.
>>>>>> 13) Back in Eclipse, edit (for example) 
>>>>>> WEB-INF/applicationContext.xml with your MySql login and save the
>>>>>> file.
>>>>>> 14) Wait for the application to republish itself.
>>>>>>
>>>>>> This is where the error occurs:
>>>>>>
>>>>>> Deployment failed due to java.lang.OutOfMemoryError: Java heap space
>>>>>>
>>>>>> I've started Eclipse with -vmargs -Xmx768M and get the same result. 
>>>>>> Not able to put 1024M in there, for some reason (Eclipse won't even 
>>>>>> start).
>>>>>>
>>>>>> --Dale--
>>>>>>
>>>
>>
> 

Re: [geronimo] Re: Out of memory during second publish - reproduced

Posted by "Steve H." <st...@sjlt.co.uk>.
I'm getting this error consistently after increasing the memory allocation
for Eclipse and Geronimo.

I'm running on OpenSUSE 10.3 x64 with Geronimo 2.1.3 on a machine with 2GB
RAM.

Output from 'ps aux | grep java' and Eclipse error trace shown below: -

Output of 'ps aux | grep java' following PermGen crash in Geronimo.

steve     4325 17.9 18.6 1474804 383908 ?      Sl   23:43   1:38
/usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/jre/bin/java -Xmx512m
-XX:MaxPermSize=512m -jar
/usr/share/eclipse/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
-os linux -ws gtk -arch x86_64 -showsplash -launcher
/usr/share/eclipse/eclipse -name Eclipse --launcher.library
/usr/share/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.0.101.R34x_v20080731/eclipse_1115.so
-startup
/usr/share/eclipse/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
-exitdata 160002 -vm /usr/bin/java -vmargs -Xmx512m -XX:MaxPermSize=512m
-jar
/usr/share/eclipse/plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
steve     4835 27.1 14.8 518960 305744 ?       Sl   23:44   2:13
/usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/bin/java
-javaagent:/usr/local/geronimo-tomcat6-javaee5-2.1.3/bin/jpa.jar
-Djava.ext.dirs=/usr/local/geronimo-tomcat6-javaee5-2.1.3/lib/ext:/usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/jre/lib/ext
-Djava.endorsed.dirs=/usr/local/geronimo-tomcat6-javaee5-2.1.3/lib/endorsed:/usr/lib64/jvm/java-1.6.0.u7-sun-1.6.0.u7/jre/lib/endorsed
-Xmx512m -XX:MaxPermSize=512m -Dfile.encoding=UTF-8 -classpath
/usr/local/geronimo-tomcat6-javaee5-2.1.3/bin/server.jar
org.apache.geronimo.cli.daemon.DaemonCLI --long
steve    10155  0.0  0.0   5120   788 pts/1    R+   23:52   0:00 grep java

Trace from Eclipse

23:51:10,653 WARN  [Settings] Settings: Could not parse struts.locale
setting, substituting default VM locale
23:51:31,757 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.OutOfMemoryError: PermGen space
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
etc...

Output show below: -

Tim McConnell wrote:
> 
> 
> That's wonderful Dale !! Please let me know if you have any other
> problems. BTW, 
> I've open the following JIRA to fix similar problems.....
> 
> -----> https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-543
> 
> DRS2 Usenet wrote:
>> Tim McConnell wrote:
>> 
>> (snip)
>>> 4.  Page down in that section and append your VM arguments at the end 
>>> -- don't delete those that are already there. I used the same ones 
>>> that Kevan used, but I'm using Java 1.5 and I see that you're using 
>>> Java 1.6:
>>>
>>>     -Xmx512m -XX:MaxPermSize=256m
>> (snip)
>>> Please try this and let me know what happens. I think you'll have 
>>> better results now. Meanwhile, I'm going to open a GEP JIRA to 
>>> investigate if we can programmatically determine and set the Geronimo 
>>> server VM arguments using those already established for Eclipse since 
>>> obviously the default values for the server are not always sufficient. 
>>> Thanks much.
>> Thanks Tim, That worked great.  I'd been using "run configurations" to 
>> make the Geronimo JVM settings... never tried double clicking on the 
>> server.  I've been able to republish many times without error AND 
>> without restarting the server (this is really a NICE feature!).
>>>
>>>
>>> Tim McConnell wrote:
>>>> Hi Dale, just a quick note to tell you that I can now reproduce your 
>>>> failure. Looking for a resolution, and will let you know what I find 
>>>> out.....
>>>>
>>>> DRS2 Usenet wrote:
>>>>> I had already installed jdk1.6.0_06
>>>>> I had already installed Geronimo: 
>>>>> geronimo-tomcat6-javaee5-2.1.3-bin.zip
>>>>> I installed a fresh Ganymede: eclipse-jee-ganymede-SR1-win32.zip
>>>>> Added Geronimo 2.1 plugins from within Eclipse.
>>>>> Then I deployed a web application.  The first time, it deploys 
>>>>> fine.  The second time, I get an out of memory, due to heap space.
>>>>>
> 
>>>>> The web application may be found here: 
>>>>> http://www.manning.com/dbrown/SampleApplication.zip
>>>>>
>>>>> 1) Download the source code from above, and unzip.
>>>>> 2) copy Struts2InAction.war to Struts2InAction.zip
>>>>> 3) Unzip the Struts2InAction.zip file to a folder called WebContent 
>>>>> and delete Struts2InAction.zip
>>>>> 4) Validate that your WebContent has WEB-INF, index.html, etc.
>>>>> 5) In your Eclipse workspace folder, create a folder called 
>>>>> Struts2InAction, and move your WebContent folder into it.
>>>>> 6) Start Eclipse
>>>>> 7) Right-click in Project Explorer, New > Project > Web > Dynamic 
>>>>> Web Project (next)
>>>>> 8) Project name: Struts2InAction > select Geronimo 2.1 > (next)
>>>>> 9) Leave Context Root and Content Directory, but change Java Source 
>>>>> Directory to WebContent/WEB-INF/src > (finish)
>>>>> 10) Right-click your project > Run As > Run On Server
>>>>> 11) Point browser at http://localhost:8080/Struts2InAction 
>>>>> <http://localhost:8080/HelloWorld>
>>>>> 12) index.html will say "one moment please" while the jsp compiles, 
>>>>> then the menu will come-up.
>>>>> 13) Back in Eclipse, edit (for example) 
>>>>> WEB-INF/applicationContext.xml with your MySql login and save the
>>>>> file.
>>>>> 14) Wait for the application to republish itself.
>>>>>
>>>>> This is where the error occurs:
>>>>>
>>>>> Deployment failed due to java.lang.OutOfMemoryError: Java heap space
>>>>>
>>>>> I've started Eclipse with -vmargs -Xmx768M and get the same result. 
>>>>> Not able to put 1024M in there, for some reason (Eclipse won't even 
>>>>> start).
>>>>>
>>>>> --Dale--
>>>>>
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Out-of-memory-during-second-publish---reproduced-tp20805951s134p21180759.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: [geronimo] Re: Out of memory during second publish - reproduced

Posted by Tim McConnell <ti...@gmail.com>.
That's wonderful Dale !! Please let me know if you have any other problems. BTW, 
I've open the following JIRA to fix similar problems.....

-----> https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-543

DRS2 Usenet wrote:
> Tim McConnell wrote:
> 
> (snip)
>> 4.  Page down in that section and append your VM arguments at the end 
>> -- don't delete those that are already there. I used the same ones 
>> that Kevan used, but I'm using Java 1.5 and I see that you're using 
>> Java 1.6:
>>
>>     -Xmx512m -XX:MaxPermSize=256m
> (snip)
>> Please try this and let me know what happens. I think you'll have 
>> better results now. Meanwhile, I'm going to open a GEP JIRA to 
>> investigate if we can programmatically determine and set the Geronimo 
>> server VM arguments using those already established for Eclipse since 
>> obviously the default values for the server are not always sufficient. 
>> Thanks much.
> Thanks Tim, That worked great.  I'd been using "run configurations" to 
> make the Geronimo JVM settings... never tried double clicking on the 
> server.  I've been able to republish many times without error AND 
> without restarting the server (this is really a NICE feature!).
>>
>>
>> Tim McConnell wrote:
>>> Hi Dale, just a quick note to tell you that I can now reproduce your 
>>> failure. Looking for a resolution, and will let you know what I find 
>>> out.....
>>>
>>> DRS2 Usenet wrote:
>>>> I had already installed jdk1.6.0_06
>>>> I had already installed Geronimo: 
>>>> geronimo-tomcat6-javaee5-2.1.3-bin.zip
>>>> I installed a fresh Ganymede: eclipse-jee-ganymede-SR1-win32.zip
>>>> Added Geronimo 2.1 plugins from within Eclipse.
>>>> Then I deployed a web application.  The first time, it deploys 
>>>> fine.  The second time, I get an out of memory, due to heap space.
>>>>
>>>> The web application may be found here: 
>>>> http://www.manning.com/dbrown/SampleApplication.zip
>>>>
>>>> 1) Download the source code from above, and unzip.
>>>> 2) copy Struts2InAction.war to Struts2InAction.zip
>>>> 3) Unzip the Struts2InAction.zip file to a folder called WebContent 
>>>> and delete Struts2InAction.zip
>>>> 4) Validate that your WebContent has WEB-INF, index.html, etc.
>>>> 5) In your Eclipse workspace folder, create a folder called 
>>>> Struts2InAction, and move your WebContent folder into it.
>>>> 6) Start Eclipse
>>>> 7) Right-click in Project Explorer, New > Project > Web > Dynamic 
>>>> Web Project (next)
>>>> 8) Project name: Struts2InAction > select Geronimo 2.1 > (next)
>>>> 9) Leave Context Root and Content Directory, but change Java Source 
>>>> Directory to WebContent/WEB-INF/src > (finish)
>>>> 10) Right-click your project > Run As > Run On Server
>>>> 11) Point browser at http://localhost:8080/Struts2InAction 
>>>> <http://localhost:8080/HelloWorld>
>>>> 12) index.html will say "one moment please" while the jsp compiles, 
>>>> then the menu will come-up.
>>>> 13) Back in Eclipse, edit (for example) 
>>>> WEB-INF/applicationContext.xml with your MySql login and save the file.
>>>> 14) Wait for the application to republish itself.
>>>>
>>>> This is where the error occurs:
>>>>
>>>> Deployment failed due to java.lang.OutOfMemoryError: Java heap space
>>>>
>>>> I've started Eclipse with -vmargs -Xmx768M and get the same result. 
>>>> Not able to put 1024M in there, for some reason (Eclipse won't even 
>>>> start).
>>>>
>>>> --Dale--
>>>>
> 
> 

Re: [geronimo] Re: Out of memory during second publish - reproduced

Posted by DRS2 Usenet <DR...@sengsational.com>.
Tim McConnell wrote:

(snip)
> 4.  Page down in that section and append your VM arguments at the end 
> -- don't delete those that are already there. I used the same ones 
> that Kevan used, but I'm using Java 1.5 and I see that you're using 
> Java 1.6:
>
>     -Xmx512m -XX:MaxPermSize=256m
(snip)
> Please try this and let me know what happens. I think you'll have 
> better results now. Meanwhile, I'm going to open a GEP JIRA to 
> investigate if we can programmatically determine and set the Geronimo 
> server VM arguments using those already established for Eclipse since 
> obviously the default values for the server are not always sufficient. 
> Thanks much.
Thanks Tim, That worked great.  I'd been using "run configurations" to 
make the Geronimo JVM settings... never tried double clicking on the 
server.  I've been able to republish many times without error AND 
without restarting the server (this is really a NICE feature!).
>
>
> Tim McConnell wrote:
>> Hi Dale, just a quick note to tell you that I can now reproduce your 
>> failure. Looking for a resolution, and will let you know what I find 
>> out.....
>>
>> DRS2 Usenet wrote:
>>> I had already installed jdk1.6.0_06
>>> I had already installed Geronimo: 
>>> geronimo-tomcat6-javaee5-2.1.3-bin.zip
>>> I installed a fresh Ganymede: eclipse-jee-ganymede-SR1-win32.zip
>>> Added Geronimo 2.1 plugins from within Eclipse.
>>> Then I deployed a web application.  The first time, it deploys 
>>> fine.  The second time, I get an out of memory, due to heap space.
>>>
>>> The web application may be found here: 
>>> http://www.manning.com/dbrown/SampleApplication.zip
>>>
>>> 1) Download the source code from above, and unzip.
>>> 2) copy Struts2InAction.war to Struts2InAction.zip
>>> 3) Unzip the Struts2InAction.zip file to a folder called WebContent 
>>> and delete Struts2InAction.zip
>>> 4) Validate that your WebContent has WEB-INF, index.html, etc.
>>> 5) In your Eclipse workspace folder, create a folder called 
>>> Struts2InAction, and move your WebContent folder into it.
>>> 6) Start Eclipse
>>> 7) Right-click in Project Explorer, New > Project > Web > Dynamic 
>>> Web Project (next)
>>> 8) Project name: Struts2InAction > select Geronimo 2.1 > (next)
>>> 9) Leave Context Root and Content Directory, but change Java Source 
>>> Directory to WebContent/WEB-INF/src > (finish)
>>> 10) Right-click your project > Run As > Run On Server
>>> 11) Point browser at http://localhost:8080/Struts2InAction 
>>> <http://localhost:8080/HelloWorld>
>>> 12) index.html will say "one moment please" while the jsp compiles, 
>>> then the menu will come-up.
>>> 13) Back in Eclipse, edit (for example) 
>>> WEB-INF/applicationContext.xml with your MySql login and save the file.
>>> 14) Wait for the application to republish itself.
>>>
>>> This is where the error occurs:
>>>
>>> Deployment failed due to java.lang.OutOfMemoryError: Java heap space
>>>
>>> I've started Eclipse with -vmargs -Xmx768M and get the same result. 
>>> Not able to put 1024M in there, for some reason (Eclipse won't even 
>>> start).
>>>
>>> --Dale--
>>>


Re: Out of memory during second publish - reproduced

Posted by Tim McConnell <ti...@gmail.com>.
Hi Dale, sorry to take so long -- I should have recognized this immediately. What 
is not always obvious when using the GEP is that there really are two JVM's 
running: one for Eclipse and another one for the Geronimo server. And 
unfortunately, the JVM arguments you establish for Eclipse do not apply to the 
Geronimo server. To adjust the JVM arguments for the Geronimo server do this:

1.  In Eclipse make sure the server is stopped

2.  Go to the Servers view in Eclipse (i.e., the same view that you use to 
start/stop the server), and double-click on the server. This will bring up the 
Overview panel for the server, which is essentially the properties editor for the 
Geronimo server adapter.

3.  Page down and on the right side you'll see the section title "Server VM 
Arguments"

4.  Page down in that section and append your VM arguments at the end -- don't 
delete those that are already there. I used the same ones that Kevan used, but 
I'm using Java 1.5 and I see that you're using Java 1.6:

	-Xmx512m -XX:MaxPermSize=256m

5. Close the editor and save your changes. Now the server will pick up these new 
VM arguments when you restart it and you can deploy/redeploy as many times as you 
wish. I did it at least five times in the same Eclipse invocation using the 
instructions you provided (i.e., editing the applicationContext.xml) and it 
worked fine for me, whereas before I couldn't even deploy it the first time 
successfully.

Please try this and let me know what happens. I think you'll have better results 
now. Meanwhile, I'm going to open a GEP JIRA to investigate if we can 
programmatically determine and set the Geronimo server VM arguments using those 
already established for Eclipse since obviously the default values for the server 
are not always sufficient. Thanks much.


Tim McConnell wrote:
> Hi Dale, just a quick note to tell you that I can now reproduce your 
> failure. Looking for a resolution, and will let you know what I find 
> out.....
> 
> DRS2 Usenet wrote:
>> I had already installed jdk1.6.0_06
>> I had already installed Geronimo: geronimo-tomcat6-javaee5-2.1.3-bin.zip
>> I installed a fresh Ganymede: eclipse-jee-ganymede-SR1-win32.zip
>> Added Geronimo 2.1 plugins from within Eclipse.
>> Then I deployed a web application.  The first time, it deploys fine.  
>> The second time, I get an out of memory, due to heap space.
>>
>> The web application may be found here: 
>> http://www.manning.com/dbrown/SampleApplication.zip
>>
>> 1) Download the source code from above, and unzip.
>> 2) copy Struts2InAction.war to Struts2InAction.zip
>> 3) Unzip the Struts2InAction.zip file to a folder called WebContent 
>> and delete Struts2InAction.zip
>> 4) Validate that your WebContent has WEB-INF, index.html, etc.
>> 5) In your Eclipse workspace folder, create a folder called 
>> Struts2InAction, and move your WebContent folder into it.
>> 6) Start Eclipse
>> 7) Right-click in Project Explorer, New > Project > Web > Dynamic Web 
>> Project (next)
>> 8) Project name: Struts2InAction > select Geronimo 2.1 > (next)
>> 9) Leave Context Root and Content Directory, but change Java Source 
>> Directory to WebContent/WEB-INF/src > (finish)
>> 10) Right-click your project > Run As > Run On Server
>> 11) Point browser at http://localhost:8080/Struts2InAction 
>> <http://localhost:8080/HelloWorld>
>> 12) index.html will say "one moment please" while the jsp compiles, 
>> then the menu will come-up.
>> 13) Back in Eclipse, edit (for example) WEB-INF/applicationContext.xml 
>> with your MySql login and save the file.
>> 14) Wait for the application to republish itself.
>>
>> This is where the error occurs:
>>
>> Deployment failed due to java.lang.OutOfMemoryError: Java heap space
>>
>> I've started Eclipse with -vmargs -Xmx768M and get the same result. 
>> Not able to put 1024M in there, for some reason (Eclipse won't even 
>> start).
>>
>> --Dale--
>>
> 

Re: Out of memory during second publish - reproduced

Posted by DRS2 Usenet <DR...@sengsational.com>.
Kevan Miller wrote:
> FYI, I just ran a number of deploy, hit url, undeploy cycles without 
> hitting any problems. I wasn't using Eclipse, but don't think that 
> should cause a difference...
>
> I used the following Java settings for my server:
>
> export JAVA_OPTS="-Xmx512m -XX:MaxPermSize=256m 
> -XX:+HeapDumpOnOutOfMemoryError"
That's the ticket!  On my Eclipse startup,
I added "-vmargs -Xmx512m -XX:MaxPermSize=256m"
and in eclipse.ini I added -Xmx512m -XX:MaxPermSize=256m (on separate lines)
and also on the "run configuration" for Geronimo 2.1
I added -Xmx512m -XX:MaxPermSize=256m and started the
server from the run configuration.

I've deployed / undeployed four times without error!! Success!!

I'm not sure the memory config is required in all of those places.
My machine seems to have only one copy of the javaw.exe, even when
Geronimo is running, so it's apparently running as a child of the VM 
that Eclipse
starts.  Never learned much about how that nesting is supposed to work, or
whether the ini or command line Eclipse stuff "wins".  But it's working, so
thanks for the tip.

--Dale--

Re: Out of memory during second publish - reproduced

Posted by Kevan Miller <ke...@gmail.com>.
On Dec 4, 2008, at 2:22 PM, Tim McConnell wrote:

> Hi Dale, just a quick note to tell you that I can now reproduce your  
> failure. Looking for a resolution, and will let you know what I find  
> out.....

FYI, I just ran a number of deploy, hit url, undeploy cycles without  
hitting any problems. I wasn't using Eclipse, but don't think that  
should cause a difference...

I used the following Java settings for my server:

export JAVA_OPTS="-Xmx512m -XX:MaxPermSize=256m -XX: 
+HeapDumpOnOutOfMemoryError"

--kevan


Re: Out of memory during second publish - reproduced

Posted by Tim McConnell <ti...@gmail.com>.
Hi Dale, just a quick note to tell you that I can now reproduce your failure. 
Looking for a resolution, and will let you know what I find out.....

DRS2 Usenet wrote:
> I had already installed jdk1.6.0_06
> I had already installed Geronimo: geronimo-tomcat6-javaee5-2.1.3-bin.zip
> I installed a fresh Ganymede: eclipse-jee-ganymede-SR1-win32.zip
> Added Geronimo 2.1 plugins from within Eclipse.
> Then I deployed a web application.  The first time, it deploys fine.  
> The second time, I get an out of memory, due to heap space.
> 
> The web application may be found here: 
> http://www.manning.com/dbrown/SampleApplication.zip
> 
> 1) Download the source code from above, and unzip.
> 2) copy Struts2InAction.war to Struts2InAction.zip
> 3) Unzip the Struts2InAction.zip file to a folder called WebContent and 
> delete Struts2InAction.zip
> 4) Validate that your WebContent has WEB-INF, index.html, etc.
> 5) In your Eclipse workspace folder, create a folder called 
> Struts2InAction, and move your WebContent folder into it.
> 6) Start Eclipse
> 7) Right-click in Project Explorer, New > Project > Web > Dynamic Web 
> Project (next)
> 8) Project name: Struts2InAction > select Geronimo 2.1 > (next)
> 9) Leave Context Root and Content Directory, but change Java Source 
> Directory to WebContent/WEB-INF/src > (finish)
> 10) Right-click your project > Run As > Run On Server
> 11) Point browser at http://localhost:8080/Struts2InAction 
> <http://localhost:8080/HelloWorld>
> 12) index.html will say "one moment please" while the jsp compiles, then 
> the menu will come-up.
> 13) Back in Eclipse, edit (for example) WEB-INF/applicationContext.xml 
> with your MySql login and save the file.
> 14) Wait for the application to republish itself.
> 
> This is where the error occurs:
> 
> Deployment failed due to java.lang.OutOfMemoryError: Java heap space
> 
> I've started Eclipse with -vmargs -Xmx768M and get the same result. Not 
> able to put 1024M in there, for some reason (Eclipse won't even start).
> 
> --Dale--
> 

Re: Out of memory during second publish - reproduced

Posted by RunHua Chi <ch...@gmail.com>.
Changing the eclipse.ini vmargs changes the heap size to run Eclipse, while
for your application, you might need to change heap size from "Run
configuration".

Jeff Chi



DRS2 Usenet wrote:
> 
> I had already installed jdk1.6.0_06
> I had already installed Geronimo: geronimo-tomcat6-javaee5-2.1.3-bin.zip
> I installed a fresh Ganymede: eclipse-jee-ganymede-SR1-win32.zip
> Added Geronimo 2.1 plugins from within Eclipse.
> Then I deployed a web application.  The first time, it deploys fine.  
> The second time, I get an out of memory, due to heap space.
> 
> The web application may be found here: 
> http://www.manning.com/dbrown/SampleApplication.zip
> 
> 1) Download the source code from above, and unzip.
> 2) copy Struts2InAction.war to Struts2InAction.zip
> 3) Unzip the Struts2InAction.zip file to a folder called WebContent and 
> delete Struts2InAction.zip
> 4) Validate that your WebContent has WEB-INF, index.html, etc.
> 5) In your Eclipse workspace folder, create a folder called 
> Struts2InAction, and move your WebContent folder into it.
> 6) Start Eclipse
> 7) Right-click in Project Explorer, New > Project > Web > Dynamic Web 
> Project (next)
> 8) Project name: Struts2InAction > select Geronimo 2.1 > (next)
> 9) Leave Context Root and Content Directory, but change Java Source 
> Directory to WebContent/WEB-INF/src > (finish)
> 10) Right-click your project > Run As > Run On Server
> 11) Point browser at http://localhost:8080/Struts2InAction 
> <http://localhost:8080/HelloWorld>
> 12) index.html will say "one moment please" while the jsp compiles, then 
> the menu will come-up.
> 13) Back in Eclipse, edit (for example) WEB-INF/applicationContext.xml 
> with your MySql login and save the file.
> 14) Wait for the application to republish itself.
> 
> This is where the error occurs:
> 
> Deployment failed due to java.lang.OutOfMemoryError: Java heap space
> 
> I've started Eclipse with -vmargs -Xmx768M and get the same result. Not 
> able to put 1024M in there, for some reason (Eclipse won't even start).
> 
> --Dale--
> 
> 

-- 
View this message in context: http://www.nabble.com/Out-of-memory-during-second-publish---reproduced-tp20805951s134p20806658.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.