Skip to main content
rajkumar_singh
Gold ⭐️
Gold ⭐️
December 24, 2016

HiveMetastore is crashing with Java Heap Space Error

  • October 5, 2026 at 9:32 AM
  • 0 replies
  • 2327 views
  • Translate All

SYMPTOM:

hivemetastore crashing with outofmemoryerror during ACID compactions.

ERROR [Thread-13]: compactor.Cleaner (Cleaner.java:run(140)) - Caught an exception in the main loop of compactor cleaner, java.lang.OutOfMemoryError: Java heap space
ERROR [Thread-13]: compactor.Cleaner (Cleaner.java:run(140)) - Caught an exception in the main loop of compactor cleaner, java.lang.OutOfMemoryError: Java heap space

ROOT CAUSE:

Enabled heap dump on outofmemory, after Analysis the heap dump we found that there are lots of entries for FileSystem$Cache$Key,FileSystem objects which was causing a memory leak

WORKAROUND:

set fs.hdfs.impl.disable.cache=true

set fs.file.impl.disable.cache=true

RESOLUTION:

this has been fixed in https://issues.apache.org/jira/browse/HIVE-13151, so apply a patch to avoid this.