Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 May 2008 12:09:14 +0200 (CEST)
From:      Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl>
To:        Brad Penoff <penoff@cs.ubc.ca>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: resident memory limit
Message-ID:  <20080521120905.T6581@wojtek.tensor.gdynia.pl>
In-Reply-To: <b89c3c270805201320i36955dccv9c643543e1b3c291@mail.gmail.com>
References:  <b89c3c270805201320i36955dccv9c643543e1b3c291@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> a problem when I run on FreeBSD (6.3 or 7).  The issue is the memory
> footprint for the application (osubw_sctpclien below) is quite large;
> on Linux it can be as much as 950 MB in resident memory, according to
> top.  However, on FreeBSD I start to get ENOMEM always around the time
> my resident memory size is about 200 MB.
>

check ulimit

then fix login.conf

> I read a few posts and have seen people fixing their problems by
> adjusting kern.maxdsiz in /boot/loader.conf and/or by adding a swap
> file.  I've tried both and for my application, it still seems to be
> limited to 200 MB resident memory regardless of maxdsize and swap file
> setting.  I wrote a toy application (malloctest below) that calls
> malloc in a while(1) and breaks once it gets ENOMEM (doing another
> while(1) so it doesn't exit); this application's memory size in top
> always matches the kern.maxdsiz setting, however it has a very low
> resident memory number, according to top.
>
> I have all the data below from these two applications.  For
> malloctest, I can malloc as much as maxdsiz allows (without panic'ing
> the kernel).  My main question is, in FreeBSD how can I increase the
> permitted resident memory of the system for my application to beyond
> 200 MB?  Any ideas where this 200 MB resident memory limit is coming
> from?  Why (in the last data entry below) does the resident memory
> limit become 80 MB after I increase maxdsiz AND use a swap file (the
> settings where malloctest can malloc the most!)?
>
> Thanks!
> brad
>
>
> Using FreeBSD 6.3.....
>
>
> kern.maxdsiz  default setting ( 524288 kB )
> no swap file.
>
> Mem: 218M Active, 9184K Inact, 36M Wired, 14M Buf, 1739M Free
> Swap: 512M Total, 512M Free
>
>  PID USERNAME  THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
>  978 root        4 118    0   203M   201M RUN      0:12  0.00% osubw_sctpclien
>
> ... separate run...
>
>  969 penoff      1 125    0   513M  1144K RUN      0:09 90.73% malloctest
>
> ------------------------------------------
>
> kern.maxdsiz  default setting ( 524288 kB )
> 512 MB swap file.
>
> Mem: 218M Active, 9144K Inact, 36M Wired, 12K Cache, 14M Buf, 1739M Free
> Swap: 1024M Total, 1024M Free
>
>  PID USERNAME  THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
>  982 root        3 120    0   203M   201M RUN      0:13  0.00% osubw_sctpclien
>
> ... separate run...
>
>  967 penoff      1 126    0   513M  1144K RUN      0:10 94.60% malloctest
>
> ------------------------------------------
>
>
> kern.maxdsiz="2147483648"               # Set the max data size
> no swap file.
>
> Mem: 218M Active, 9168K Inact, 36M Wired, 14M Buf, 1739M Free
> Swap: 512M Total, 512M Free
>
>  PID USERNAME  THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
>  967 root        3 122    0   203M   201M RUN      0:31  0.00% osubw_sctpclien
>
> ... separate run...
>
>  980 root        1 129    0  2050M  2680K RUN      0:12 97.64% malloctest
>
>
> ----------------------------------------
>
> kern.maxdsiz="2147483648"               # Set the max data size
> 512 MB swap file.
>
> Mem: 220M Active, 12M Inact, 41M Wired, 12K Cache, 20M Buf, 1730M Free
> Swap: 1024M Total, 1024M Free
>
>  PID USERNAME  THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
> 1041 root        4  20    0   204M   202M kserel   0:04  0.00% osubw_sctpclien
>
> ... separate run...
>
>  967 root        1 121    0  2050M  2680K RUN      0:07 93.16% malloctest
>
> ----------------------------------------
> kern.maxdsiz="3000000000"
> no swap file
>
> kernel panic
> ----------------------------------------
>
> kern.maxdsiz="3000000000"               # Set the max data size
> 512 MB swap file.
>
>
> Mem: 103M Active, 52M Inact, 106M Wired, 112M Buf, 1742M Free
> Swap: 1024M Total, 1024M Free
>
>  PID USERNAME  THR PRI NICE   SIZE    RES STATE    TIME   WCPU COMMAND
> 15286 root        2 128    0 81172K 79080K RUN      1:47  0.00% osubw_sctpclien
>
> ... separate run...
>
>  963 penoff      1 122    0  2865M  3500K RUN      0:08 96.62% malloctest
>
> -----------------------------------------
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080521120905.T6581>