Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7416629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:32:10+00:00 2026-05-29T07:32:10+00:00

I know there are same questions like this one been asked and answered. I

  • 0

I know there are same questions like this one been asked and answered. I am not satisfied with the answers so let me put into more detail messages here.

I try to start my application with JVM OPTs: -Xmx128m -Xms32m -XX:MaxPermSize=64m. When the app started and I check the memory usage by typing cat /proc/10413/status, and I found the vmsize is more than 600512 kB! which is way bigger than my settings. I’d like to know how to limit the jvm memory usage of the process.

Name:   java
State:  S (sleeping)
Tgid:   10413
Pid:    10413
PPid:   1
TracerPid:      0
Uid:    1001    1001    1001    1001
Gid:    1007    1007    1007    1007
FDSize: 128
Groups: 1001 1007
**VmPeak:   728472 kB**
**VmSize:   600512 kB**
VmLck:         0 kB
VmHWM:    298300 kB
VmRSS:    280912 kB
VmData:   647804 kB
VmStk:       140 kB
VmExe:        36 kB
VmLib:     13404 kB
VmPTE:       808 kB
VmSwap:        0 kB
Threads:        33
SigQ:   0/31522
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000000000000
SigCgt: 2000000181005ccf
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: ffffffffffffffff
Cpus_allowed:   f
Cpus_allowed_list:      0-3
Mems_allowed:   00000000,00000001
Mems_allowed_list:      0
voluntary_ctxt_switches:        3
nonvoluntary_ctxt_switches:     2
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:32:11+00:00Added an answer on May 29, 2026 at 7:32 am

    You can’t control what you want to control, -Xmx only controls the Java Heap, it doesn’t control consumption of native memory by the JVM, which is consumed completely differently based on implementation.

    From the following article Thanks for the Memory ( Understanding How the JVM uses Native Memory on Windows and Linux )

    Maintaining the heap and garbage collector use native memory you can’t control.

    More native memory is required to maintain the state of the
    memory-management system maintaining the Java heap. Data structures
    must be allocated to track free storage and record progress when
    collecting garbage. The exact size and nature of these data structures
    varies with implementation, but many are proportional to the size of
    the heap.

    and the JIT compiler uses native memory just like javac would

    Bytecode compilation uses native memory (in the same way that a static
    compiler such as gcc requires memory to run), but both the input (the
    bytecode) and the output (the executable code) from the JIT must also
    be stored in native memory. Java applications that contain many
    JIT-compiled methods use more native memory than smaller applications.

    and then you have the classloader(s) which use native memory

    Java applications are composed of classes that define object structure
    and method logic. They also use classes from the Java runtime class
    libraries (such as java.lang.String) and may use third-party
    libraries. These classes need to be stored in memory for as long as
    they are being used. How classes are stored varies by implementation.

    I won’t even start quoting the section on Threads, I think you get the idea that
    -Xmx doesn’t control what you think it controls, it controls the JVM heap, not everything
    goes in the JVM heap, and the heap takes up way more native memory that what you specify for
    management and book keeping.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this type of question has been asked before, but I could not
I know there are plenty of other questions addressing the same problem, but since
I know there should not be multiple publishers publishing the same event. But how
I know there have been a lot of questions similar to my small problem.
I know there are plenty of questions here already about this topic (I've read
I know variants of this question have been asked frequently before (see here and
This one's been tricky to quantify, so I may not have this question worded
I know this has been asked a billion times before, but I'm still having
Variations of this question have been asked before, but it seems like the issue
I know there have been several questions in the past regarding things that compile

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.