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

  • Home
  • SEARCH
  • 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 3676672
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:07:39+00:00 2026-05-19T03:07:39+00:00

With the -Xms and -Xmx Options, it is possible to set the initial and

  • 0

With the -Xms and -Xmx Options, it is possible to set the initial and maximum size of the memory allocation pool. Using strace/truss on Linux and AIX I found out, the JVM internally uses the (k)mmap system call. The address-Parameter is NULL, therefore the operating system decides, at which virtual memory address it maps the memory.

$ truss java -Xmx512M Hello 2>&1 | grep mmap
kmmap(0x00000000, 536870912, 3, 17, -1, 0x00000000, 0x00000000) = 0xB0000000

Is is possible, to specify this address?

Background: I have to call legacy code via the Java Native Interface (JNI), which requires huge amounts of non-relocateable data (2 GB in a 32 bit address space) mapped at a specific location in memory. This region overlaps with the location of Javas memory allocation pool.

Edit: This is the actual memory layout:

0x0... AIX
0x1... Text
0x2... Stack
0x3... Heap
0x4... Heap
...... Legacy Data (2 GB)
0xd... Shared Library Text
0xe... unused
0xf... Shared Library Data

My goal is to move the Java memory allocation pool from 0xb/0xc into the 0x3/0x4 segments, which is also available in the standard (non large) memory model.

  • 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-19T03:07:40+00:00Added an answer on May 19, 2026 at 3:07 am

    Perhaps you could turn this problem inside-out. Start a native process, and do what you need to do to reserve your non-negotiable space (mmap or whatever). Then use Java’s invocation API to create and start a JVM inside your native process. I can’t find any documentation about how that JVM does its memory management, but it stands to reason that it will play nicely with memory that has already been allocated by the host process (i would guess it just uses the local malloc), so it will find somewhere else to put its heap. If you leave the 0x3-0x4 region unallocated, you can hope it will put it there.

    However, i think there’s a real risk that there just isn’t enough address space left in your memory model for a JVM. The 0x3-0x4 region is, what, 512 MB? If you can fit a whole JVM (heap, stack, perm, VM structures, etc) in there, then fine, but if not, you may find that when the JVM can’t allocate contiguous memory for the heap, it gets very upset. Or it may not. I really don’t know.

    So, having suggested this, i would strongly recommend that you don’t do it, and instead follow sleske’s advice and put the native code in a separate process.

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

Sidebar

Related Questions

No related questions found

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.