Re: OutOfMemoryError "unable to createnew native thread" after successful build

Oliver Pfau <[email protected]>
Newsgroups gmane.comp.java.cruise-control.user
Message-ID <[email protected]>
I found out that the OutOfMemoryError does not occur if I do not "watch" the build state in the dashboard. How Joe wrote, there is an issue about that. I switched back to CC 2.6.2. I tried a lot of CC_OPTS settings without success. I tried on 2 machines. First machine has 1 Gb RAM which is not sufficient I think. The second has 4 Gb RAM with 5 Gbyte Swap, enougth harddisk space and "not so much" other running processes.

Regards,
Oliver
 

-----Ursprüngliche Nachricht-----
Von: Ulrich Romahn [mailto:[email protected]] 
Gesendet: Dienstag, 8. September 2009 19:24
An: [email protected]
Betreff: Re: [Cruisecontrol-user] OutOfMemoryError "unable to createnew native thread" after successful build


Oliver,

by reviewing your stack trace below, it seems pretty clear to me that although your machine has 4GB of RAM, your JVM does not seem to get the 1024MB requested from the OS. I suspect you have too many other processes running so that the OS could not obtain enough RAM for the JVM once it requested the 1GB plus you seem to have either no or not enough Swap space.

What I would recommend to avoid such an issue is to set your options as follows:

CC_OPTS=-Xms1024m -Xmx1024m

That way, your JVM gets the 1GB at start time and you should find out if even that is not enough.
The only drawback of this approach is that startup of CC would be slightly slower, but that is not too big of a prize compared to an Exception-free execution.

Hope that helps,
-Uli

-----Original Message-----
From: Oliver Pfau [mailto:[email protected]]
Sent: Monday, September 07, 2009 8:27 AM
To: '[email protected]'
Subject: Re: [Cruisecontrol-user] OutOfMemoryError "unable to createnew native thread" after successful build

This almost occurs after the first build. Sometimes after the second. Does this not occur if I do not use the dashboard with the ajaxified state ? 

-----Ursprüngliche Nachricht-----
Von: Joe Schmetzer [mailto:[email protected]]
Gesendet: Montag, 7. September 2009 17:21
An: [email protected]
Betreff: Re: [Cruisecontrol-user] OutOfMemoryError "unable to create new native thread" after successful build

Does this problem occasionally after CC has been running for a long-ish period of time? Perhaps this is the memory leak issue that occurs when a brower watches an in-progress build. A fix has been committed to subversion, but his has not yet been released:
http://jira.public.thoughtworks.org/browse/CC-831

Regards,
Joe

2009/9/7 Oliver Pfau <[email protected]>:
> Hi,
>
> after a successful build I get an OutOfMemoryError. My machine has 4 
> Gbyte RAM.
> The CC_OPTS=CC_OPTS=-Xms128m -Xmx1024m
>
> Here is my config.xml:
>
> <cruisecontrol>
>   <plugin name="svnbootstrapper"
> classname="net.sourceforge.cruisecontrol.bootstrappers.SVNBootstrapper
> " />
>   <project name="{project.name}">
>     <listeners>
>   <currentbuildstatuslistener file="logs/{project.name}/status.txt"/>
>     </listeners>
>     <bootstrappers>
>             <antbootstrapper
> anthome="D:/CruiseControlTestEnv/Projekte/trunk/ant"
> buildfile="D:/CruiseControlTestEnv/Projekte/trunk/ant/build.xml"
> target="clean"
>  />
>     </bootstrappers>
>     <modificationset>
>       <!-- touch any file in project to trigger a build -->
>       <svn LocalWorkingCopy="D:/CruiseControlTestEnv/Projekte/trunk" 
> />
>     </modificationset>
>     <schedule interval="3600" ShowProgress="true">
>       <ant
> antscript="D:/CruiseControlTestEnv/Projekte/trunk/ant/bin/ant.bat"
> buildfile="D:/CruiseControlTestEnv/Projekte/trunk/ant/build.xml"
> target="nightlyBuild"
> antWorkingDir="D:/CruiseControlTestEnv/Projekte/trunk/ant"
> usedebug="false" ShowProgress="true" UseQuiet="true" UseLogger="false"
> multiple="1" showAntOutput="false">
>       </ant>
>     </schedule>
>  <log>
>   <merge dir="D:/CruiseControlTestEnv/Projekte/trunk/target/
> temp/testreports"/>
>  </log>
>     <publishers>
>     </publishers>
>   </project>
>   <dashboard />
> </cruisecontrol>
>
>
>
> Here is the stack trace:
> [cc]Sep-07 16:20:13 ScriptRunner  -      [echo] nightly pICS build 
> finished at
> 2009-09-07 16:20:13.887 for SVN revision
> 60684 and can be found in E:/pICS Builds/1.7.0.60684.
> [cc]Sep-07 16:20:13 ScriptRunner  -
> [cc]Sep-07 16:20:13 ScriptRunner  - BUILD SUCCESSFUL
> [cc]Sep-07 16:20:13 ScriptRunner  - Total time: 35 minutes 46 seconds
> 2009-09-07 16:20:23.453::WARN:  /dashboard/getProjectBuildOutput.ajax
> java.lang.OutOfMemoryError: unable to create new native thread
>         at java.lang.Thread.start0(Native Method)
>         at java.lang.Thread.start(Thread.java:597)
>         at
> mx4j.remote.AbstractRemoteNotificationClientHandler$NotificationDelivererThread.
> start(AbstractRemoteNotificat
> ionClientHandler.java:507)
>         at
> mx4j.remote.AbstractRemoteNotificationClientHandler$NotificationDelivererThread.
> access$300(AbstractRemoteNoti
> ficationClientHandler.java:444)
>         at
> mx4j.remote.AbstractRemoteNotificationClientHandler.start(AbstractRemo
> teNotifica
> tionClientHandler.java:81)
>         at
> javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:132
> )
>         at
> javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactor
> y.java:38)
>         at
> net.sourceforge.cruisecontrol.dashboard.service.JMXConnectorFactory.co
> nnect(JMXC
> onnectorFactory.java:10)
>         at
> net.sourceforge.cruisecontrol.dashboard.repository.BuildInformationRep
> ositoryInM
> emoImpl.getJmxConnection(Buil
> dInformationRepositoryInMemoImpl.java:44)
>         at
> net.sourceforge.cruisecontrol.dashboard.service.BuildLoopQueryService.
> getJMXConn
> ection(BuildLoopQueryService.
> java:152)
>         at
> net.sourceforge.cruisecontrol.dashboard.service.BuildLoopQueryService.
> getBuildOu
> tput(BuildLoopQueryService.ja
> va:135)
>         at
> net.sourceforge.cruisecontrol.dashboard.web.GetProjectBuildOutputContr
> oller.hand
> leRequest(GetProjectBuildOutp
> utController.java:62)
>         at
> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.han
> dle(Simple
> ControllerHandlerAdapter.java
> :48)
>         at
> org.springframework.web.servlet.DispatcherServlet.doDispatch(Dispatche
> rServlet.j
> ava:858)
>         at
> org.springframework.web.servlet.DispatcherServlet.doService(Dispatcher
> Servlet.ja
> va:792)
>         at
> org.springframework.web.servlet.FrameworkServlet.processRequest(Framew
> orkServlet
> .java:476)
>         at
> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServle
> t.java:431
> )
>         at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>         at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>         at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>         at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:36
> 2)
>         at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java
> :216)
>         at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:18
> 1)
>         at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:72
> 9)
>         at
> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>         at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandl
> erCollecti
> on.java:206)
>         at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.j
> ava:114)
>         at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:15
> 2)
>         at org.mortbay.jetty.Server.handle(Server.java:324)
>         at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505
> )
>         at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpCon
> nection.ja
> va:829)
>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
>         at
> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
>         at
> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
>         at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.jav
> a:395)
>         at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
> va:488)
> #
> # An unexpected error has been detected by Java Runtime Environment:
> #
> # java.lang.OutOfMemoryError: requested 1024000 bytes for GrET in 
> C:\BUILD_AREA\jdk6_03\hotspot\src\share\vm\utilities\g
> rowableArray.cpp. Out of swap space?
> #
> #  Internal Error (414C4C4F434154494F4E0E494E4C494E450E4850500017),
> pid=9592,
> tid=4692
> #
> # Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode) # An 
> error report file with more information is saved as hs_err_pid9592.log 
> # # If you would like to submit a bug report, please visit:
> #   http://java.sun.com/webapps/bugreport/crash.jsp
> #
> D:\CruiseControlTestEnv\cruisecontrol-bin-2.8.2>
>
> Has anyone an idea ? I do not know what to try else.
>
> Regards
> Oliver
>
> ----------------------------------------------------------------------
> -------- Let Crystal Reports handle the reporting - Free Crystal 
> Reports 2008 30-Day trial. Simplify your report design, integration 
> and deployment - and focus on what you do best, core application 
> coding. Discover what's new with Crystal Reports now.
> http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Cruisecontrol-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user
>
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july _______________________________________________
Cruisecontrol-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july _______________________________________________
Cruisecontrol-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user

=======
Notice: This e-mail message, together with any attachments, contains information of Symyx Technologies, Inc. or any of its affiliates or subsidiaries that may be confidential, proprietary, copyrighted, privileged and/or protected work product, and is meant solely for the intended recipient. If you are not the intended recipient, and have received this message in error, please contact the sender immediately, permanently delete the original and any copies of this email and any attachments thereto.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july _______________________________________________
Cruisecontrol-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.