1

I have an application that is running inside a kubernetes container, and the container keeps restarting. I checked the reason with kubectl logs -f <pod-name> -n <name-space> --previous

and found the following issue FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

checking the pod status in instana, I got the following logs.

enter image description here

Checking zooming further in the profile got me the following.

enter image description here

does this mean an idle nodejs process keeps utilising the memory ! or there are some other snippets that are running in that process? what does <(idle)>at:0 mean?

isnvi23h4
  • 1,910
  • 1
  • 27
  • 45
  • 2
    Sawtooth pattern is a classic sign of memory leak. The high CPU usage could be due to `malloc()` working harder to find free memory – slebetman Dec 12 '22 at 08:36

1 Answers1

0

As per the Error FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory, the memory used by the Javascript process(JVM) is much more than the heap size.

The system where the containers are running starts to have memory problems (restarts) because the container is taking much more memory than the heap size.

Check below Solutions :

  1. Setting up the Docker limits to watch the memory usage in a normal state of the process.

  2. There is no guaranteed way to estimate full memory usage of a Java process, because there are too many factors to consider. It is possible to shrink or limit certain memory areas (like Code Cache) by JVM flags, but many others are out of JVM control at all.

Refer to this SO for more information.

Veera Nagireddy
  • 1,656
  • 1
  • 3
  • 12