Subject: Re: How to globally increase maximum data segment size?
To: Chris <humptymoo@gmail.com>
From: matthew sporleder <msporleder@gmail.com>
List: netbsd-users
Date: 06/19/2007 08:43:16
On 6/19/07, Chris <humptymoo@gmail.com> wrote:
> On 19/06/07, Chris <humptymoo@gmail.com> wrote:
> > Hi,
> >
> > I'm trying to run a Java application, but it fails with an out of
> > memory exception. On a Linux box, I
> > can see that it's using almost 1Gb of memory:
> >
> >                                    VIRT   RES    SHR
> > 27726 root      25   0 1021m 558m  14m S    0 22.0  96:02.11 java
> >
> > I've tried to increase the various limits on my NetBSD box using
> > /etc/login.conf, but it appears
> > that the hard limits compiled into the GENERIC kernel (it's netbsd-4
> > from a recent daily build),
> > are too low. Reading options(4) I see that I can set various options
> > such as MAXDSIZ and
> > build a custom kernel. I was wondering what options I would need to
> > set, and what to set the
> > to, in order to ensure that a process like the one shown above would
> > run on my NetBSD box.
> >
>
> OK, after a bit of experimentation I've now got things running, so
> just in case anyone's interested here's what I had to do. Recompile
> the kernel, with the only change from GENERIC being an options MAXDSIZ
> line:
>
> options MAXDSIZ="2147483648U"
>
> Then once that was built and in place I added the following to ~/.profile:
>
> export CATALINA_OPTS="-Xms128m -Xmx1024m"
>
> ulimit -s 8192
> ulimit -d 2040288
> ulimit -l 2040288
>
> Following a reboot I'm able to start the webapp, and after a little
> light testing it seems to run fine!


Were you getting Java OutOfMemory errors or netbsd out of memory errors?