Newsgroup: it.comp.java
Titolo: Java heap space

Su un sito che ho sviluppato ongi tanto mi compare l'errore che
trovate sotto.
Facendo delle prove sul mio pc non sono riuscito a riprodurlo, quindi
brancolo nel buoi. Avete idee sulle possibili cause e soprattutto su
come indagare ?
2009-08-13 10:24:03,058 [ERROR] org.apache.catalina.core.ContainerBase.
[Catalina].[localhost].[/main].[action] - Servlet.service() for
servlet action threw exception
java.lang.OutOfMemoryError: Java heap space
	at java.io.ByteArrayOutputStream.<init>(ByteArrayOutputStream.java:
60)
	at org.apache.commons.fileupload.DeferredFileOutputStream.<init>
(DeferredFileOutputStream.java:131)
	at org.apache.commons.fileupload.DefaultFileItem.getOutputStream
(DefaultFileItem.java:558)
	at org.apache.commons.fileupload.FileUploadBase.parseRequest
(FileUploadBase.java:406)
	at
org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest
(CommonsMultipartRequestHandler.java:193)
	at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:
442)
	at org.apache.struts.action.RequestProcessor.processPopulate
(RequestProcessor.java:816)
	at org.apache.struts.action.RequestProcessor.process
(RequestProcessor.java:203)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:
1196)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:
432)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:178)
	at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:126)
	at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:105)
	at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:107)
	at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:148)
	at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:869)
	at org.apache.coyote.http11.Http11BaseProtocol
$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
664)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
(PoolTcpEndpoint.java:527)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt
(LeaderFollowerWorkerThread.java:80)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:684)
	at java.lang.Thread.run(Thread.java:619)
2009-08-13 09:34:37,413 [ERROR] org.apache.catalina.core.ContainerBase.
[Catalina].[localhost].[/main].[action] - Servlet.service() for
servlet action threw exception
java.lang.OutOfMemoryError: Java heap space
	at java.io.ByteArrayOutputStream.<init>(ByteArrayOutputStream.java:
60)
	at org.apache.commons.fileupload.DeferredFileOutputStream.<init>
(DeferredFileOutputStream.java:131)
	at org.apache.commons.fileupload.DefaultFileItem.getOutputStream
(DefaultFileItem.java:558)
	at org.apache.commons.fileupload.FileUploadBase.parseRequest
(FileUploadBase.java:406)
	at
org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest
(CommonsMultipartRequestHandler.java:193)
	at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:
442)
	at org.apache.struts.action.RequestProcessor.processPopulate
(RequestProcessor.java:816)
	at org.apache.struts.action.RequestProcessor.process
(RequestProcessor.java:203)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:
1196)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:
432)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:178)
	at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:126)
	at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:105)
	at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:107)
	at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:148)
	at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:869)
	at org.apache.coyote.http11.Http11BaseProtocol
$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
664)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket
(PoolTcpEndpoint.java:527)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt
(LeaderFollowerWorkerThread.java:80)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:684)
	at java.lang.Thread.run(Thread.java:619)

 (FileUploadBase.java:406)
direi che come primo step potresti provare ad aumentare la memoria massima
assegnata all'istanza di TomCat, e successivamente, se � vero che c'� di 
mezzo
un file upload, vedere se a fronte di quell'operazione la memoria � 
opportunamente
rilasciata (i file descriptor sono chiusi, i buffer intermedi sono ripuliti 
etc)
Scorpio.