WriteBuffer

Main menu

Skip to content
  • Home
  • About

Post navigation

← IntelliJ IDEA Notes
Java SDK notes →

Solve “java.lang.OutOfMemoryError: Java heap space”

Posted on 2017-08-08
by writer

Use -Xmx to set the maximum heap size (which may use hard drive space as Java heap). e.g. set the max heap size to 10GB:

java -Xmx10g MainClass

It may be further optimized using garbage collectors such ConcurrentMarkSweep:

java -Xmx10g -XX:+UseConcMarkSweepGC MainClass
Posted in Tech | Tagged java

Post navigation

← IntelliJ IDEA Notes
Java SDK notes →

Ads

Categories

  • Life
  • Tech

Tags

android apache C++ dev efficiency gadget hardware java latex Linux living Mac ml Music mysql reading security shell shortcut time management tools tor video VirtualBox windows Xcode

Recent Posts

  • Fix Visual Studio Code can’t update issue on macOS
  • “afterEvaluate” in Gradle
  • Visual Studio run unit tests for x64 only
  • Install XPS Viewer on Windows 10
  • Install Windows 10 after Ubuntu 18.04

Ads

This site is powered by WordPress and styled with SemPress