DEV Community

Your Java Container Is Lying to You About Its Memory (opens in new tab)

Discussed on DEV

The part of memory Java doesn't tell you about Java doesn't just use heap. The JVM also allocates: Metaspace — class metadata, loaded by the JVM itself Code cache — JIT-compiled native code Thread stacks — each thread gets its own Direct byte buffers (NIO) — allocated off-heap by many libraries Internal JVM bookkeeping This is called native memory, and it's invisible to your usual heap monitoring. When your container hits its cgroup memory limit, the kernel doesn't care how much heap you have...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help