2016-09-22 284 views
0

我看着下面,沒有什麼幫助:How to deal with "java.lang.OutOfMemoryError: Java heap space" error (64MB heap size)IntelliJ IDEA的無法啓動

昨天的IntelliJ IDEA是工作正常。今天當我啓動程序時,會發生以下情況:

[email protected]:~/dev/java$ /opt/idea-IC-162.2032.8/bin/idea.sh 

(java:7471): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap", 

(java:7471): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap", 

(java:7471): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap", 

(java:7471): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap", 
java.lang.OutOfMemoryError: Java heap space 
Dumping heap to /home/karl/java_error_in_IDEA.hprof ... 
Unable to create /home/karl/java_error_in_IDEA.hprof: File exists 
[ 5467] ERROR - llij.ide.plugins.PluginManager - Java heap space 
java.lang.OutOfMemoryError: Java heap space 
    at java.util.Arrays.copyOf(Arrays.java:3236) 
    at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118) 
    at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93) 
    at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:135) 
    at sun.font.XRGlyphCacheEntry.writePixelData(XRGlyphCacheEntry.java:154) 
    at sun.font.XRGlyphCache.generateGlyphImageStream(XRGlyphCache.java:217) 
    at sun.font.XRGlyphCache.uploadGlyphs(XRGlyphCache.java:164) 
    at sun.font.XRGlyphCache.cacheGlyphs(XRGlyphCache.java:134) 
    at sun.font.XRTextRenderer.drawGlyphList(XRTextRenderer.java:81) 
    at sun.java2d.pipe.GlyphListPipe.drawString(GlyphListPipe.java:72) 
    at sun.java2d.SunGraphics2D.drawString(SunGraphics2D.java:2928) 
    at sun.swing.SwingUtilities2.drawString(SwingUtilities2.java:593) 
    at sun.swing.SwingUtilities2.drawStringUnderlineCharAt(SwingUtilities2.java:612) 
    at javax.swing.plaf.basic.BasicGraphicsUtils.drawStringUnderlineCharAt(BasicGraphicsUtils.java:246) 
    at com.intellij.ui.plaf.beg.IdeaMenuUI.paint(IdeaMenuUI.java:169) 
    at com.intellij.ui.plaf.beg.IdeaMenuUI.update(IdeaMenuUI.java:405) 
    at javax.swing.JComponent.paintComponent(JComponent.java:780) 
    at javax.swing.JComponent.paint(JComponent.java:1056) 
    at javax.swing.JComponent.paintChildren(JComponent.java:889) 
    at com.intellij.openapi.wm.impl.IdeMenuBar.paintChildren(IdeMenuBar.java:400) 
    at javax.swing.JComponent.paint(JComponent.java:1065) 
    at com.intellij.openapi.wm.impl.IdeMenuBar.paint(IdeMenuBar.java:160) 
    at javax.swing.JComponent.paintChildren(JComponent.java:889) 
    at javax.swing.JComponent.paint(JComponent.java:1065) 
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:586) 
    at javax.swing.JComponent.paintChildren(JComponent.java:889) 
    at javax.swing.JComponent.paintToOffscreen(JComponent.java:5217) 
    at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579) 
    at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502) 
    at javax.swing.RepaintManager.paint(RepaintManager.java:1272) 
    at javax.swing.JComponent.paint(JComponent.java:1042) 
    at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39) 
[ 5470] ERROR - llij.ide.plugins.PluginManager - IntelliJ IDEA 2016.2.4 Build #IC-162.2032.8 
[ 5471] ERROR - llij.ide.plugins.PluginManager - JDK: 1.8.0_112-release 
[ 5471] ERROR - llij.ide.plugins.PluginManager - VM: OpenJDK 64-Bit Server VM 
[ 5471] ERROR - llij.ide.plugins.PluginManager - Vendor: JetBrains s.r.o 
[ 5471] ERROR - llij.ide.plugins.PluginManager - OS: Linux 
[ 5471] ERROR - llij.ide.plugins.PluginManager - Last Action: 
[ 7947] ERROR - llij.ide.plugins.PluginManager - Java heap space 
java.lang.OutOfMemoryError: Java heap space 
    at java.util.Arrays.copyOf(Arrays.java:3236) 
    at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118) 
    at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93) 
    at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:135) 
    at sun.font.XRGlyphCacheEntry.writePixelData(XRGlyphCacheEntry.java:154) 
    at sun.font.XRGlyphCache.generateGlyphImageStream(XRGlyphCache.java:217) 
    at sun.font.XRGlyphCache.uploadGlyphs(XRGlyphCache.java:164) 
    at sun.font.XRGlyphCache.cacheGlyphs(XRGlyphCache.java:134) 
    at sun.font.XRTextRenderer.drawGlyphList(XRTextRenderer.java:81) 
    at sun.java2d.pipe.GlyphListPipe.drawString(GlyphListPipe.java:72) 
    at sun.java2d.SunGraphics2D.drawString(SunGraphics2D.java:2928) 
    at sun.swing.SwingUtilities2.drawString(SwingUtilities2.java:593) 
    at sun.swing.SwingUtilities2.drawStringUnderlineCharAt(SwingUtilities2.java:612) 
    at javax.swing.plaf.basic.BasicGraphicsUtils.drawStringUnderlineCharAt(BasicGraphicsUtils.java:246) 
    at com.intellij.ui.plaf.beg.IdeaMenuUI.paint(IdeaMenuUI.java:169) 
    at com.intellij.ui.plaf.beg.IdeaMenuUI.update(IdeaMenuUI.java:405) 
    at javax.swing.JComponent.paintComponent(JComponent.java:780) 
    at javax.swing.JComponent.paint(JComponent.java:1056) 
    at javax.swing.JComponent.paintChildren(JComponent.java:889) 
    at com.intellij.openapi.wm.impl.IdeMenuBar.paintChildren(IdeMenuBar.java:400) 
    at javax.swing.JComponent.paint(JComponent.java:1065) 
    at com.intellij.openapi.wm.impl.IdeMenuBar.paint(IdeMenuBar.java:160) 
    at javax.swing.JComponent.paintChildren(JComponent.java:889) 
    at javax.swing.JComponent.paint(JComponent.java:1065) 
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:586) 
    at javax.swing.JComponent.paintChildren(JComponent.java:889) 
    at javax.swing.JComponent.paintToOffscreen(JComponent.java:5217) 
    at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579) 
    at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502) 
    at javax.swing.RepaintManager.paint(RepaintManager.java:1272) 
    at javax.swing.JComponent.paint(JComponent.java:1042) 
    at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39) 
[ 7948] ERROR - llij.ide.plugins.PluginManager - IntelliJ IDEA 2016.2.4 Build #IC-162.2032.8 
[ 7948] ERROR - llij.ide.plugins.PluginManager - JDK: 1.8.0_112-release 
[ 7948] ERROR - llij.ide.plugins.PluginManager - VM: OpenJDK 64-Bit Server VM 
[ 7948] ERROR - llij.ide.plugins.PluginManager - Vendor: JetBrains s.r.o 
[ 7948] ERROR - llij.ide.plugins.PluginManager - OS: Linux 
[ 7948] ERROR - llij.ide.plugins.PluginManager - Last Action: 
# 
# A fatal error has been detected by the Java Runtime Environment: 
# 
# SIGSEGV (0xb) at pc=0x00007f966c3184b4, pid=7471, tid=0x00007f95e895c700 
# 
# JRE version: OpenJDK Runtime Environment (8.0_112-b87) (build 1.8.0_112-release-b343) 
# Java VM: OpenJDK 64-Bit Server VM (25.112-b343 mixed mode linux-amd64 compressed oops) 
# Problematic frame: 
# C [libc.so.6+0x14d4b4] 
# 
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again 
# 
# An error report file with more information is saved as: 
# /home/karl/java_error_in_IDEA_7471.log 
# 
# If you would like to submit a bug report, please visit: 
# http://bugreport.java.com/bugreport/crash.jsp 
# The crash happened outside the Java Virtual Machine in native code. 
# See problematic frame for where to report the bug. 
# 
Aborted (core dumped) 

顯然我內存不足。我知道我不是:

Every 5,0s: free -m                                       Thu Sep 22 09:22:56 2016 

       total  used  free  shared buff/cache available 
Mem:   15950  2047  11913   537  1989  12999 
Swap:   3813   0  3813 

我也試過以下/opt/idea-IC-162.2032.8/bin/idea.sh -Xms512m,得到了錯誤:

[email protected]:~$ /opt/idea-IC-162.2032.8/bin/idea.sh -Xms512m 

(java:10414): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap", 

(java:10414): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap", 

(java:10414): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap", 

(java:10414): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap", 
# 
# A fatal error has been detected by the Java Runtime Environment: 
# 
# SIGSEGV (0xb) at pc=0x00007f1a501644b4, pid=10414, tid=0x00007f19c87a4700 
# 
# JRE version: OpenJDK Runtime Environment (8.0_112-b87) (build 1.8.0_112-release-b343) 
# Java VM: OpenJDK 64-Bit Server VM (25.112-b343 mixed mode linux-amd64 compressed oops) 
# Problematic frame: 
# C [libc.so.6+0x14d4b4] 
# 
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again 
# 
# An error report file with more information is saved as: 
# /home/karl/java_error_in_IDEA_10414.log 
# 
# If you would like to submit a bug report, please visit: 
# http://bugreport.java.com/bugreport/crash.jsp 
# The crash happened outside the Java Virtual Machine in native code. 
# See problematic frame for where to report the bug. 
# 
Aborted (core dumped) 

我運行64位,所以我創建的文件~/.IdeaIC2016.2/idea64.vmoptions與內容:

-Xms1024m 
-Xmx1024m 

仍然不起作用。

+0

就像Eclipse一樣,是否有一種.ini文件,您可以在其中爲您的JVM添加一些參數?也許這只是IntelliJ的過程需要更多的內存,而不是你的電腦上沒有剩下任何東西。 – MadJlzz

+0

@MadJlzz我嘗試追加將參數-Xms512m添加到命令(我更新了問題)。我會看看.ini文件。 –

+0

檢查可以爲JVM添加參數的文件。很確定這會在你增加Intellij的JVM堆後解決你的問題。 – MadJlzz

回答

2

哇,沒有人知道這件事感到驚訝,是不是Java應該是巨大的?哦,她的答案非常簡單,只要知道IDE運行的是JDK就可以使用env變量。我只需將它設置爲一個可以工作的JDK,而不是內置的JDK。

export IDEA_JDK=/usr/lib/jvm/jdk1.8.0_101/