public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Maximum heap size?
@ 2001-12-05 11:06 Adam McKenna
  2001-12-05 11:26 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Adam McKenna @ 2001-12-05 11:06 UTC (permalink / raw)
  To: linux-kernel

I have been STFW'ing for a few hours now and I keep finding conflicting
reports on what the maximum heap size is with Linux 2.4.  Some places say it
is 1GB, and others say it is unlimited.

Background:  We have a java process that dies if the -mx flag passed to java
is more than 1GB.  Our developers say it is a Linux bug (since we don't
have the same problem on Solaris).  We are using Sun J2SE/JDK 1.3.1.

Any clarification would be appreciated.

Thanks,

--Adam

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Maximum heap size?
  2001-12-05 11:06 Adam McKenna
@ 2001-12-05 11:26 ` Alan Cox
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Cox @ 2001-12-05 11:26 UTC (permalink / raw)
  To: Adam McKenna; +Cc: linux-kernel

> I have been STFW'ing for a few hours now and I keep finding conflicting
> reports on what the maximum heap size is with Linux 2.4.  Some places say it
> is 1GB, and others say it is unlimited.

You have 3Gb of virtual space for an application on x86. This is basically
hardware limitations of the processor (1Gb is used for kernel mappings and
having kernel and user mappings overlapping costs every syscall)

If you are hitting a 1GB limit I would assume the jvm isn't very bright
about its allocation of resources. You should run out at something like
2.5Gb of allocations. (you lose some to app and library maps)

Alan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Maximum heap size?
       [not found] ` <fa.h8gf0vv.18kimh8@ifi.uio.no>
@ 2001-12-05 20:34   ` Dan Maas
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Maas @ 2001-12-05 20:34 UTC (permalink / raw)
  To: adam-dated-1007982419.3acea7; +Cc: linux-kernel

> If you are hitting a 1GB limit I would assume the jvm isn't very bright
> about its allocation of resources. You should run out at something like
> 2.5Gb of allocations. (you lose some to app and library maps)

Specifically, the jvm is probably getting memory from brk(), because brk()
only operates in the ~1GB region between 0x08000000 + epsilon (where the
executable ends) and 0x40000000 (where shared libs begin). The easiest way
to get more than 1GB is to mmap() anonymous pages (which will come from the
remaining ~2GB region between 0x40000000 and 0xBFFFFFFF). e.g. glibc will
use anonymous mmap() to fulfill large malloc() requests.

Regards,
Dan


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-12-05 20:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <fa.g60uruv.1n5cija@ifi.uio.no>
     [not found] ` <fa.h8gf0vv.18kimh8@ifi.uio.no>
2001-12-05 20:34   ` Maximum heap size? Dan Maas
2001-12-05 11:06 Adam McKenna
2001-12-05 11:26 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox