Maximum size of data segment used by c program

Rajat Sharma fs.rajat at
Mon Sep 17 07:07:24 EDT 2012

On Mon, Sep 17, 2012 at 4:34 PM, devendra.aaru <devendra.aaru at> wrote:
> > On Mon, Sep 17, 2012 at 6:17 AM, Rajat Sharma <fs.rajat at> wrote:
> >> yes there is a limit, look at
> >>
> > getrlimit show the size as 4GiGs of RLIMIT_DATA on a 32-bit. which
> > means that its unlimited?
> >
> I mean 4Gigs of RLIMIT_DATA is both the rlim_cur and rlim_max.
> i have a data section of size 213K, i am thinking that i should not be
> growing the data section size.

yes try the c function setrlimit, thats what I meant by looking at man page.

#include <sys/time.h>
#include <sys/resource.h>

int getrlimit(int resource, struct rlimit *rlim);
int setrlimit(int resource, const struct rlimit *rlim);

> I have went through google and didn't found any article that says
> about the maximum data section a process can use.
> > Thanks,

More information about the Kernelnewbies mailing list