简体   繁体   English

Java 8字符串内存不足错误

[英]Java 8 String outofmemory error

I have a big XML file that I am parsing using SAX parser. 我有一个很大的XML文件,正在使用SAX解析器进行解析。 During the processing I create a big HashMap having key and values for parsed JSON. 在处理过程中,我创建了一个大型HashMap,其中包含用于解析的JSON的键和值。

As per my understanding, in java 8 you dont need to set any Permgen setting while running java application, it creates Strings in Heap but some how I am still getting OutOfMemoryError. 根据我的理解,在Java 8中,您无需在运行Java应用程序时设置任何Permgen设置,它会在Heap中创建Strings,但有些仍然使OutOfMemoryError出错。 Is my understanding right or I am choosing a wrong parser? 我的理解正确吗,或者我选择了错误的解析器?

You should take a look into the following - 您应该查看以下内容-

  1. Which garbage collection you are using. 您正在使用哪个垃圾收集。

  2. If you are using IDE, check if you are using correct java version. 如果使用的是IDE,请检查您使用的Java版本是否正确。 Sometimes you IDEs can have setting to run on specific JVM. 有时,您的IDE可以进行设置以在特定JVM上运行。

Which java installation you are using, BTW? 您正在使用哪个java安装,顺便说一句?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM