LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-24-2009, 04:31 PM   #1
michelangelo
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Rep: Reputation: 0
java Xmx limitation on 32bit with PAE enabled


hello,

my situation:
SUSE 2.6.5-7.155.29-bigsmp
PAE enabled: cpu flags : fpu vme de pse tsc msr pae
no limit on user: virtual memory (kbytes, -v) unlimited
15Gb RAM (physical)
Mem: 14967976 (from free command).

------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 4194303
max total shared memory (kbytes) = 13500000
min seg size (bytes) = 1

THEN
=================

1)the c program: malloc about 3.6Gb RAM. GREAT!
2)java -Xmx1950m is OK; WHILE from
3)java -Xmx1960m says
*** panic: JVMST062: Cannot allocate memory in initializeFRBits()

how can i increase contiguous mem size? (if this is the problem...)

any help!?!?!

r
michelangelo
 
Old 11-24-2009, 04:48 PM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by michelangelo View Post
cpu flags : fpu vme de pse tsc msr pae
That isn't all the CPU flags.

Do you really not have the lm flag or do you have some other reason to not switch to a 64 bit build of Linux?

Quote:
1)the c program: malloc about 3.6Gb RAM.
Are you sure?

That means you have the build of Linux that I think is called "Hugemem" by old versions of RHEL that included it, that has kernel virtual memory separate from user virtual memory. That has a lot of overhead compared to a 64 bit build. That is a bad idea if you have a choice.

Quote:
3)java -Xmx1960m says
*** panic: JVMST062: Cannot allocate memory in initializeFRBits()
How high do you want to go?

I don't know Java memory issues, so maybe there is a fix for that problem and still fit in 32 bit virtual memory. But if you want to go far beyond that, you may need 64 bit.
 
Old 11-24-2009, 05:32 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Quote:
Originally Posted by michelangelo View Post
1)the c program: malloc about 3.6Gb RAM. GREAT!
2)java -Xmx1950m is OK; WHILE from
3)java -Xmx1960m says
*** panic: JVMST062: Cannot allocate memory in initializeFRBits()

how can i increase contiguous mem size? (if this is the problem...)
Just to be clear - these are independent runs ?. The first just to very how much you can allocate, then the other two to show th point at which the error occurs ?.
If all that is true, try doing the last command immediately after a re-boot to get an indication if it is a contiguous problem.
 
Old 11-24-2009, 07:24 PM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by michelangelo View Post
how can i increase contiguous mem size? (if this is the problem...)
The issue is contiguous virtual address space within the process started by that java command.

Having less than 2GB contiguous at startup seems a little strange, but it isn't implausible.

When you start java successfully with java -Xmx1950m do you do something to make that process stay around (preferably waiting for input or other event)? If so, you can find out its pid and the look in /proc/pid/maps to see the detailed layout of virtual memory. After the big chunk allocated for the heap there must be some other mappings (probably .so files) that fragment the virtual address space preventing a larger contiguous mapping. There are methods (I don't recall them, but they exist) to control the load address of all the .so files and maybe whatever else gets in before that contiguous mapping is attempted. You should be able to get everything that now loads near the middle of the 3 or 3.6 GB virtual space to load near the beginning or near the end.

Quote:
Originally Posted by syg00 View Post
If all that is true, try doing the last command immediately after a re-boot to get an indication if it is a contiguous problem.
Since it is the virtual address space of a new process created by the java command, not anything that needs to be physically contiguous, trying it right after a reboot should make no difference.

I'm not 100% sure about the rules for virtual load address of .so files. If a .so file is already loaded by something at some address convenient to the first process that loaded it, there would be some performance advantage to loading it at the same virtual address in another process that subsequently needs it, assuming that virtual address is available. I don't know whether Linux does that kind of optimization. If it does then use of some .so before the java command might influence the virtual layout and maybe your reboot idea could have some useful effect. But I'm not sure that is possible and if it is possible it is still a difficult indirect blind approach to an issue that can be viewed directly by looking in the process maps and then attacked directly.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Suse 32bit PAE enabled. C program runs with 3.5Gb but java cannot use more than 1.8Gb michelangelo SUSE / openSUSE 2 11-24-2009 05:27 PM
Why does Ubuntu 8.04 only see 3.5GB instead of 4GB? Yes, PAE is enabled Micro420 Ubuntu 8 06-06-2008 10:16 PM
Out of memory on 16gb ram, PAE 32bit 2.6.23 heson Linux - Server 4 11-04-2007 05:54 AM
KERNEL PANIC: Cannot execute a PAE-enabled kernel on a PAE-less CPU! ovais370 Linux - Laptop and Netbook 7 10-13-2007 05:49 PM
Java Linux Process memory footprint with and without -Xmx rolandofghent Linux - General 5 09-27-2007 09:08 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration