- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我试图找出哪个方法/循环在我的应用程序中给出了 java.lang.OutOfMemoryError: Java heap space 。我对使用 Eclipse Memory Analyzer 分析 Java 应用程序还很陌生。
在图像中,很明显调用 JNI Local 具有最大保留堆,但我们的应用程序中没有任何 JNI 调用。
请检查并确认内存泄漏是否是由调用任何 native 代码(JNI Local)或使用任何字符串迭代或其他任何方式引起的?
为了引用,我附上了 .hprof 文件的总体概述和堆栈跟踪:
Accumulated Objects by Class
Label Number of Objects Used Heap Size Retained Heap Size
java.lang.String
First 10 of 15,252,128 objects 15,252,128 488,068,096 2,317,743,632
Thread Details
Thread WorkManager(2)-8
Thread Properties
Object / Stack Frame java.lang.Thread @ 0x69af09608
Name WorkManager(2)-8
Shallow Heap 112
Retained Heap 2,384,942,672
Context Class Loader org.jboss.util.loading.DelegatingClassLoader @ 0x6912bf868
Is Daemon true
Total: 6 entries
Thread Stack
WorkManager(2)-8
at java.lang.StringCoding.decode(Ljava/lang/String;[BII)[C (StringCoding.java:185)
at java.lang.String.<init>([BIILjava/lang/String;)V (String.java:451)
at java.lang.String.<init>([BLjava/lang/String;)V (String.java:523)
at java.io.UnixFileSystem.list(Ljava/io/File;)[Ljava/lang/String; (Native Method)
at java.io.File.list()[Ljava/lang/String; (File.java:990)
at java.io.File.listFiles(Ljava/io/FilenameFilter;)[Ljava/io/File; (File.java:1107)
at com.adobe.idp.dsc.service.file.impl.WatchedFolderUtils.resolveDuplicateFile(Ljava/lang/String;Z)Ljava/io/File; (WatchedFolderUtils.java:515)
at com.adobe.idp.dsc.provider.service.file.write.impl.FileResultHandlerImpl.resolveDestination(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/io/File; (FileResultHandlerImpl.java:308)
at com.adobe.idp.dsc.provider.service.file.write.impl.FileResultHandlerImpl.preserveFiles(Lcom/adobe/idp/dsc/registry/infomodel/Endpoint;Ljava/lang/String;Ljava/lang/String;)V (FileResultHandlerImpl.java:817)
at com.adobe.idp.dsc.provider.service.file.write.impl.FileResultHandlerImpl.saveResults(Lcom/adobe/idp/dsc/InvocationResponse;Lcom/adobe/idp/dsc/registry/infomodel/Endpoint;Ljava/lang/String;Ljava/lang/String;)V (FileResultHandlerImpl.java:493)
at com.adobe.idp.dsc.provider.service.file.write.impl.FileResultHandlerImpl.handleSuccess(Ljava/lang/Object;Ljava/util/Map;)V (FileResultHandlerImpl.java:104)
at com.adobe.idp.dsc.provider.service.file.write.impl.FileResultHandlerImpl.handleSuccess(Lcom/adobe/idp/dsc/InvocationResponse;)V (FileResultHandlerImpl.java:73)
at sun.reflect.GeneratedMethodAccessor2229.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Method.java:616)
at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(Lcom/adobe/idp/dsc/InvocationRequest;)Lcom/adobe/idp/dsc/InvocationResponse; (DefaultPOJOInvokerImpl.java:118)
at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(Lcom/adobe/idp/dsc/component/ComponentContext;Lcom/adobe/idp/dsc/InvocationRequest;Lcom/adobe/idp/dsc/interceptor/RequestInterceptorChain;)Lcom/adobe/idp/dsc/InvocationResponse; (InvocationInterceptor.java:140)
at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(Lcom/adobe/idp/dsc/component/ComponentContext;Lcom/adobe/idp/dsc/InvocationRequest;)Lcom/adobe/idp/dsc/InvocationResponse; (RequestInterceptorChainImpl.java:60)
at com.adobe.idp.dsc.interceptor.impl.DocumentPassivationInterceptor.intercept(Lcom/adobe/idp/dsc/component/ComponentContext;Lcom/adobe/idp/dsc/InvocationRequest;Lcom/adobe/idp/dsc/interceptor/RequestInterceptorChain;)Lcom/adobe/idp/dsc/InvocationResponse; (DocumentPassivationInterceptor.java:53)
at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(Lcom/adobe/idp/dsc/component/ComponentContext;Lcom/adobe/idp/dsc/InvocationRequest;)Lcom/adobe/idp/dsc/InvocationResponse; (RequestInterceptorChainImpl.java:60)
at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(Lcom/adobe/idp/dsc/transaction/TransactionContext;)Ljava/lang/Object; (TransactionInterceptor.java:74)
at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(Lcom/adobe/idp/dsc/transaction/TransactionContext;Lcom/adobe/idp/dsc/transaction/TransactionCallback;)Ljava/lang/Object; (EjbTransactionCMTAdapterBean.java:357)
at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(Lcom/adobe/idp/dsc/transaction/TransactionDefinition;Lcom/adobe/idp/dsc/transaction/TransactionCallback;)Ljava/lang/Object; (EjbTransactionCMTAdapterBean.java:227)
at sun.reflect.GeneratedMethodAccessor698.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Method.java:616)
at org.jboss.invocation.Invocation.performCall(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; (Invocation.java:386)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(Lorg/jboss/invocation/Invocation;)Ljava/lang/Object; (StatelessSessionContainer.java:233)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(Lorg/jboss/invocation/Invocation;)Ljava/lang/Object; (CachedConnectionInterceptor.java:156)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Lorg/jboss/invocation/Invocation;)Ljava/lang/Object; (StatelessSessionInstanceInterceptor.java:173)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(Lorg/jboss/invocation/Invocation;)Ljava/lang/Object; (CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(Lorg/jboss/invocation/Invocation;Z)Ljava/lang/Object; (AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(Lorg/jboss/invocation/Invocation;)Ljava/lang/Object; (TxInterceptorCMT.java:378)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(Lorg/jboss/invocation/Invocation;)Ljava/lang/Object; (TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.SecurityInterceptor.process(Lorg/jboss/invocation/Invocation;Z)Ljava/lang/Object; (SecurityInterceptor.java:228)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(Lorg/jboss/invocation/Invocation;)Ljava/lang/Object; (SecurityInterceptor.java:211)
at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(Lorg/jboss/invocation/Invocation;Z)Ljava/lang/Object; (PreSecurityInterceptor.java:97)
at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invoke(Lorg/jboss/invocation/Invocation;)Ljava/lang/Object; (PreSecurityInterceptor.java:81)
at org.jboss.ejb.plugins.LogInterceptor.invoke(Lorg/jboss/invocation/Invocation;)Ljava/lang/Object; (LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(Lorg/jboss/invocation/Invocation;)Ljava/lang/Object; (ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.SessionContainer.internalInvoke(Lorg/jboss/invocation/Invocation;)Ljava/lang/Object; (SessionContainer.java:650)
at org.jboss.ejb.Container.invoke(Lorg/jboss/invocation/Invocation;)Ljava/lang/Object; (Container.java:1092)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; (BaseLocalProxyFactory.java:436)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; (StatelessSessionProxy.java:103)
at $Proxy289.doSupports(Lcom/adobe/idp/dsc/transaction/TransactionDefinition;Lcom/adobe/idp/dsc/transaction/TransactionCallback;)Ljava/lang/Object; (Unknown Source)
at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(Lcom/adobe/idp/dsc/transaction/TransactionDefinition;Lcom/adobe/idp/dsc/transaction/TransactionCallback;)Ljava/lang/Object; (EjbTransactionProvider.java:104)
最佳答案
你的堆栈跟踪显示了方法UnixFileSystem.list(File)
,它是一个 native 方法,它创建一个字符串数组来存储文件名。剩下的问题是为什么它要创建一个大小为 1600 万的数组。该方法从大小为 16
的数组开始,一旦目录扫描的迭代次数超过数组大小,该方法就会将其加倍。所以现在的迭代次数在800万到1600万之间。您要么该目录中的文件数量令人难以置信,要么该 native 代码中的循环终止条件存在问题。
关于java - 查找 java.lang.OutOfMemoryError : Java heap space using Eclipse MAT 的根本原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18783957/
在 Tomcat 6/Ubuntu 12.04 上启动 Grails 2.1.0 应用程序时出现以下错误。 Error 500 - Internal Server Error. groovy.lang
在运行 Storm 拓扑时,我收到此错误。拓扑完美运行 5 分钟,没有任何错误,然后失败。我正在使用 Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS as 300 sec i
我有一个 jsp 代码在其中一台机器上运行良好。但是当我复制到另一台机器时,我得到了这个 no such method found 异常。我是 Spring 的新手。有人可以解释我错过了什么吗? 以下
已关闭。此问题需要 debugging details 。目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and the
我的代码在下面给出了一个错误; Exception in thread "main" java.lang.NoSuchMethodError: com/myApp/Client.cypherCBC(L
我正在尝试一个 Restful web 服务示例,所以当我要访问 url 时,我遇到了异常 java.lang.NoSuchMethodError: jersey.repackaged.com.goo
我正在将一个 Spring web 项目转换为一个 Maven 项目,但我收到了这个错误: java.lang.NoSuchMethodError: org.jboss.logging.Logger.
在我的项目中,我有一个像这样的枚举: public enum MyEnum { FIRST(1), SECOND(2); private int value; private MyEnum(int v
我创建了这个简单的示例,用于读取 Linux 正常运行时间: public String getMachineUptime() throws IOException { String[] di
我正在使用 Eclipse,并且正在使用 Java。我的目标是使用 bogoSort 方法对 vector 进行排序在一个 vector (vectorExample)中适应我的 vector 类型,
我正在运行以下查询。它显示一条错误消息。如何解决这个错误? ListrouteList=null; List companyList = session.createS
我有以下模型类: @Entity @Table(name="user_content") @org.hibernate.annotations.NamedQueries({ @org.
我有那个错误。这是我的代码: GmailSettingsService service = new GmailSettingsService(APPLICATION_NAME, DOMAIN_NAME
实际上我在执行我的java程序时遇到了下面提到的错误 Exception in thread "pool-1-thread-1" java.lang.ClassCastException: jav
java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.String 我在以下代码中遇到此异常: Strin
我正在尝试从 linkedhashset 中检索随机元素。下面是我的代码,但它每次都给我异常。 private static void generateRandomUserId(Set userIds
我已经完成了 Android 中的代码: List spinnerArray = new ArrayList(); for (int i = 0; i item = (LinkedTreeMap)
这个问题已经有答案了: Explanation of ClassCastException in Java (12 个回答) 已关闭 6 年前。 我已经编写了 java 到 Json 的代码,同时从页
这个问题在这里已经有了答案: ClassCastException java.lang.Long cannot be cast to clojure.lang.IFn (4 个答案) 关闭 6 年前
我在运行时遇到问题来编译这段代码,这给我一个错误,java.lang.Integer 无法转换为 Java.lang.Double。如果有人帮助我更正此代码,我将非常高兴 double x; pu
我是一名优秀的程序员,十分优秀!