Tag: out of memory

java.lang.OutOfMemoryError:PermGen space Exception

我得到这个java.lang.OutOfMemoryError: PermGen spaceexception。 我正在使用Eclipse Juno和Tomcat 7.0。 此exception在控制台中每10-15分钟至少发生一次。 怎么解决? Feb 25, 2016 10:23:23 AM org.springframework.beans.factory.support.DefaultListableBeanFactory destroyBean SEVERE: Destroy method on bean with name ‘mvcUrlPathHelper’ threw an exception java.lang.OutOfMemoryError: PermGen space at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2895) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) […]

发送HTTP时的OutputStream OutOfMemoryError

我试图将一个大的video/图像文件从本地文件系统发布到一个http路径,但一段时间后我遇到内存不足错误… 这是代码 public boolean publishFile(URI publishTo, String localPath) throws Exception { InputStream istream = null; OutputStream ostream = null; boolean isPublishSuccess = false; URL url = makeURL(publishTo.getHost(), this.port, publishTo.getPath()); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); if (conn != null) { try { conn.setDoOutput(true); conn.setDoInput(true); conn.setRequestMethod(“PUT”); istream = new FileInputStream(localPath); ostream = conn.getOutputStream(); int n; byte[] buf […]

netbeans中的Java堆空间..但我已经增加了堆大小!

我遇到了netbeans和Java的问题。 我的程序需要能够处理通过arraylist上传的大文件。 所以我使用-Xmx512m通过netbeans.conf文件增加最大堆大小。 我知道netbeans正在抓住变化,我已经多次重启以确保它是。 仍然,当总内存参数仅为66650112字节时,我的程序继续崩溃,出现Java堆空间内存错误; 也就是说,64M-ish。 我如何强制这个特定的类,过程,等等,以允许更多的内存分配?

java.lang.OutOfMemoryError:使用NetBeans的Java堆空间

这是我在NetBeans启动的Tomcat servlet容器实例中运行Web应用程序时遇到的错误。 为了解决这个问题,我甚至改变了netbeans.conf中的堆大小,但它仍然显示相同的错误。 我该如何防止这种情况发生? HTTP状态500 – ————————————————– —————————— 类型exception报告 信息 description服务器遇到内部错误(),导致无法完成此请求。 例外 javax.servlet.ServletException:Servlet执行引发exception org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362) 根本原因 java.lang.OutOfMemoryError:Java堆空间 note备注根本原因的完整堆栈跟踪在Apache Tomcat /5.5.9日志中。

垃圾收集器是否保证在Out of Memory Error之前运行?

如果堆已满,JVM将抛出OutOfMemoryError 。 但是它确保在抛出这样的exception之前总是发生(完全)垃圾收集吗? 这意味着当抛出exception时,内存只有强引用对象(或GC Roots可达)才能满。 编辑:假设Sun JVM – HotSpot正在讨论中。

通过Apache POI读取大型Excel文件(xlsx)时出错

我试图通过Apache POI读取大型excel文件xlsx,比如40-50 MB。 我失去了内存exception。 当前堆内存为3GB。 我可以毫无问题地阅读较小的excel文件。 我需要一种方法来读取大型excel文件,然后通过Spring excel视图将它们作为响应返回。 public class FetchExcel extends AbstractView { @Override protected void renderMergedOutputModel( Map model, HttpServletRequest request, HttpServletResponse response) throws Exception { String fileName = “SomeExcel.xlsx”; response.setContentType(“application/vnd.openxmlformats-officedocument.spreadsheetml.sheet”); OPCPackage pkg = OPCPackage.open(“/someDir/SomeExcel.xlsx”); XSSFWorkbook workbook = new XSSFWorkbook(pkg); ServletOutputStream respOut = response.getOutputStream(); pkg.close(); workbook.write(respOut); respOut.flush(); workbook = null; response.setHeader(“Content-disposition”, “attachment;filename=\”” +fileName+ “\””); […]