Bug 437214 - ulimit -d <size>
ulimit -d <size>
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
All Linux
medium Severity medium
: rc
: ---
Assigned To: Vitaly Mayatskikh
Martin Jenner
Depends On:
Blocks: 461304
  Show dependency treegraph
Reported: 2008-03-12 18:20 EDT by Issue Tracker
Modified: 2010-10-22 19:12 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-01-14 17:57:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
rlimit test patch (4.16 KB, patch)
2008-06-18 15:55 EDT, Linda Wang
no flags Details | Diff

  None (edit)
Comment 3 Issue Tracker 2008-03-12 18:20:40 EDT
This is going into more a kernel issue now -- this patch I've found
supposedly does what the customer is doing, however, it is not in any
upstream kernel code a s far as I can tell.


I'll see about getting this put into the kernel queue.


This event sent from IssueTracker by bbraswel  [Support Engineering Group]
 issue 165270
Comment 4 Issue Tracker 2008-03-12 18:20:41 EDT
I used a slightly modified, scaled down version of the program to test.  I
wanted to see if it made any difference if the data was dynamically or
statically allocated.  It did not make a difference.  With the memory
statically allocated, it still allowed the data to grow larger than the

However, I did find that setting the limit on total virtual memory did
take affect and blocked the program from running.

I will be looking into the vm's allocation and growth code to see if I
can determine why the limit is not being enforced.

Bill Braswell

$ cat ulimit_static.c
#include <stdio.h>
#include <stdlib.h>
#include <sys/resource.h>

#define ALLOC_SIZE 1024
#define CELL_COUNT 2000

char   array[ALLOC_SIZE * CELL_COUNT];

main ()
        struct rlimit datasize;
        int    index;

        if (-1 == getrlimit (RLIMIT_DATA, &datasize))
                perror ("Error getting limit values");
                printf ("Data limit is: %lu\\n", datasize.rlim_cur);

        for (index = 0; index <= (ALLOC_SIZE * CELL_COUNT); index +=
                array[index] = 0;
        printf("paged in %ld bytes of memory\\n", (ALLOC_SIZE *
        if (-1 == getrlimit (RLIMIT_DATA, &datasize))
                perror ("Error getting limit values");
                printf ("Data limit is: %lu\\n", datasize.rlim_cur);

$ ulimit -d 10
$ ./ulimit_static
Data limit is: 10240
paged in 2048000 bytes of memory
Data limit is: 10240
$ ulimit -v 1024
[bbraswel@bbraswel tmp]$ ./ulimit_static

This event sent from IssueTracker by bbraswel  [Support Engineering Group]
 issue 165270
Comment 7 Jerry Uanino 2008-04-07 14:14:55 EDT
Is there any progress on this?  Our developers want ulimit -d to work, we're
aware that ulimit -v works, but it's not the best choice for this particular
application.  I'll get more specifics.
Comment 13 Linda Wang 2008-06-18 15:55:55 EDT
Created attachment 309783 [details]
rlimit test patch
Comment 15 RHEL Product and Program Management 2008-06-20 00:12:58 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 16 Linda Wang 2008-06-20 00:14:55 EDT
Please let us know if the customer needs a test kernel or test rpm 
with the test patch stated in comment#13.

many thanks.
Comment 17 Eirik 2008-07-07 12:27:35 EDT
Providing the patched kernel or a test rpm would greatly help and speed up
testing on our side for providing feedback.
Comment 19 Vitaly Mayatskikh 2008-07-10 07:48:02 EDT
You can get test kernel based on RHEL-4u6 at

Only i686 and x86_64 packages are available (disk quota limits).
Comment 20 Eirik 2008-07-16 14:39:33 EDT
Thanks for the test rpms. I have installed the x86_64 kernel packages and
testing is looking good so far with ulimit now actually limiting the memory:

$ ./testRLimit
Data limit is: 18446744073709551615
[35000]Total allocation = 2293760000
$ ./malloctest
Data limit is: 18446744073709551615
[35000]Total allocation = 2293760000
$ ulimit -d 10
$ ./testRLimit
Segmentation fault (core dumped)
$ ./malloctest
Segmentation fault (core dumped)
Comment 21 Eirik 2008-07-29 10:22:51 EDT
The kernel and patch have been running now for a good while with no issues to be
seen, thanks once again. Is there an ETA on when this will be packaged into a
Comment 23 Jerry Uanino 2008-09-09 16:11:14 EDT
What does updating PM score mean?  Can we expect this to be in a release soon?
Comment 28 Jerry Uanino 2008-11-08 15:36:40 EST
any progress here. I'm a paying customer and I'd like to get it fixed. is the best route to call this into redhat and just point to this bugzilla?
Comment 29 Eirik 2009-01-06 12:01:20 EST
Still awaiting a response as well, will this be fixed in 4.8 release?
Comment 32 RHEL Product and Program Management 2009-01-14 17:57:20 EST
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.

Note You need to log in before you can comment on or make changes to this bug.