Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

max heap size on 32 bit linux ?

Thread view: 
iksrazal@gmail.com - 10 Feb 2006 20:58 GMT
Hi all,

We've recently aquired a new dual processor 3.0GHZ Xeon running Suse
9.2 . It has 4 gigs of ram. However, the JVM is crashing daily. Our app
has never shown this behavior before - though it never has run on a
machine with more than I gig of ram. Its a tomcat webapp running
hibernate. Here's the JVM args we pass to tomcat:

CATALINA_OPTS="-server -Xms512m -Xmx2048m -Xincgc -XX:PermSize=128m
-XX:MaxPermSize=512m"

We're seeing errors like:

Exception in thread "CompilerThread0" java.lang.OutOfMemoryError:
requested 1801688 bytes for Chunk::new. Out of swap space?

and:

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0xb2b5027f, pid=3630, tid=38177712
#
# Java VM: Java HotSpot(TM) Server VM (1.5.0_06-b05 mixed mode)
# Problematic frame:
# J  java.lang.StringCoding.encode(Ljava/lang/String;[CII)[B
#

Even though the machine's load average (top) is under 1. This machine
has a low load until it hits production.

I did set the ulimit:

ulimit -s 3072

I've also tried 2048.

So my question is: Can I safely allocate 2048 megs on 32 bit intel
running linux, with 4 gigs total and nothing else running that's heavy?
What's the max I can allocate?

iksrazal
http://www.braziloutsource.com/
Roedy Green - 10 Feb 2006 22:08 GMT
> Exception in thread "CompilerThread0" java.lang.OutOfMemoryError:

I saw that message for the first time a couple of days ago.  I had
simply been running applets in Opera with JRE 1.5.0_06.. I have not
yet tracked down what is going on.  

There may be some app going nuts allocating stuff. Or it could be a gc
bug not collecting trash, or the JVM could be packratting. You need a
profiler to tell you want all the junk is that is accumulating.

There is one other horrible possibility that a hardware error in ram
gets reported as an out of memory error. I hope that is not so.

see http://mindprod.com/jgloss/profiler.html
http://mindprod.com/jgloss/packratting.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Douwe - 10 Feb 2006 22:18 GMT
The question is: why did you buy a big machine ? probably since the
tomcat was crashing all the time. Now you've got bigger machine and
still it crashes. So are you running this all inside a cluster? If not
then install something like a VMWare or Xen, install linux twice on the
same machine and then run a tomcat on both linux systems and run them
in cluster mode.

If this is absolutely not what you want to then you should A: check if
you have enough Swap Space since the error report sais "Out of swap
space?" and/or B: report a bug at java.sun.com.
iksrazal@gmail.com - 10 Feb 2006 23:04 GMT
> The question is: why did you buy a big machine ? probably since the
> tomcat was crashing all the time. Now you've got bigger machine and
> still it crashes.

The jvm never crashed in our test environments, spanning several
different machines over a years time. Nor on any developers machine. We
simply bought a bigger machine because the app is going into production
soon. And so far there's only been light testing.

iksrazal
http://www.braziloutsource.com/
Luc The Perverse - 10 Feb 2006 23:31 GMT
>> The question is: why did you buy a big machine ? probably since the
>> tomcat was crashing all the time. Now you've got bigger machine and
[quoted text clipped - 7 lines]
> iksrazal
> http://www.braziloutsource.com/

It's possible the computer itself is unstable.

Test ram with a knoppix or linux install disk.

If it passes, run a burn in test.

--
LTP

:)
hussainak@gmail.com - 11 Feb 2006 00:15 GMT
well i will suggest try installing latest Red Hat and test ...try with
both gjc and jvm
masseyke@gmail.com - 10 Feb 2006 23:23 GMT
I saw strange error messages like this running my Java application on
Linux.  The problem turned out to be a memory leak in some native code
I was using -- Oracle JDBC drivers.  The JVM was not running out of
memory -- the operating system was.  Java was throwing an
OutOfMemoryError and other errors not because it had hit its maximum
heap size, but because the operating system would not allocate it any
more memory.  Fortunately for me, there was a pure Java implementation,
and after I switched to that the problem went away.
I don't know if this helps you at all, but you might check into which,
if any, native code your application is using.  And it doesn't explain
why the problems would have started happening just recently.

Keith
tom fredriksen - 11 Feb 2006 23:17 GMT
You could possibly try to use vmstat and such tools to track the system
memory to see which process is using what memory. By doing this, you at
least, are able to verify where the memory problem is.

There are is a linux tool called memtest86 which performs all from
simple to complex memory testing, which you could use the check for
memory problems. It can take a while for the complex tests though,
perhaps a day or two (it should run a couple of iterations).

There is also a linux hardware diagnostics program (dont remember the
name of it) which will test the entire system to see if there are any
devices or components with problems.

If none of these things turn up anything then your best bet might
probably be to profile or diagnose the program it self.

/tom

> Hi all,
>
[quoted text clipped - 39 lines]
> iksrazal
> http://www.braziloutsource.com/
ossie.moore@gmail.com - 12 Feb 2006 06:25 GMT
This has to do with the max memory a particular process can occupy. I
believe the *default* value most vendors us in workstation editions of
Linux is 2GB of ram per process (minus some overhead). You can
reconfigure your kernel manually to allow more memory, or, if you are
not comfortable doing that, purchase an enterprise edition support
package.

Here's an old post i found by googling for "linux max memory per
process"...
http://lists.samba.org/archive/linux/2005-November/014552.html


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.