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

  • Notes on Kensington LD5400T TB3 Dock
  • Add Keyboard Shortcut for “Sleep” on macOS Ventura
  • Fix Whirlpool Washer No Water Coming In
  • Enable ZSWAP on Ubuntu
  • Add seller filter to “Amazon.com” on Amazon

Ads

This site is powered by WordPress and styled with SemPress