RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 852516 - emacs produces "Emergency (alloc): Warning: past 95% of memory limit"
Summary: emacs produces "Emergency (alloc): Warning: past 95% of memory limit"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: emacs
Version: 6.3
Hardware: ppc64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Petr Hracek
QA Contact: Stefan Kremen
URL:
Whiteboard:
Depends On:
Blocks: 1075802 1077836 1159825
TreeView+ depends on / blocked
 
Reported: 2012-08-28 18:42 UTC by Neal Kim
Modified: 2019-03-22 07:03 UTC (History)
7 users (show)

Fixed In Version: emacs-23.1-27.el6
Doc Type: Bug Fix
Doc Text:
Cause: If PC has enough memory then emacs shows memory warning Consequence: If user edits a file and PC has enough memory then this warning is shown Fix: Remove warning so that now most PCs have enough memory Result: Warning is not shown anymore
Clone Of:
: 1077836 (view as bug list)
Environment:
Last Closed: 2015-02-19 12:27:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
POC of a possible approach to fix the feature (480 bytes, text/x-csrc)
2014-03-19 16:47 UTC, Marcel Kolaja
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0238 0 normal SHIPPED_LIVE emacs bug fix update 2015-02-19 17:26:58 UTC

Description Neal Kim 2012-08-28 18:42:54 UTC
Description of problem:

Starting up emacs produces:

"Emergency (alloc): Warning: past 95% of memory limit"


Version-Release number of selected component (if applicable):

emacs-23.1-21.el6_2.3.ppc64


How reproducible:

Very.


Steps to Reproduce:

1. Run attached debug emacs executable
2. Note the start address in the output
3. Compare start address to that reported in /proc/<PID>/maps

Like so:

data_size=1099680684112, cp=0x1001a5d0000, start=0x104967b0

# grep heap /proc/6573/maps
1001a5a0000-1001a600000 rw-p 00000000 00:00 0                            [heap]


Actual results:

data_space_start value is innacurate causing the memory warning.


Expected results:

Accurate data_space_start value and no memory warning.


Additional info:

The customer was told:

"""
The warning is the result of the emacs code not correctly determining the start of the data segment. This is causing its calculation for the total data_size to be incorrect. This appears to have been a consistent problem for it across multiple architectures.

The past approach has been to hard-code the starting address as a kludge. This does not look like it will work for this architecture as the location of the data segment can be a bit variable.
                                                                    
The warning itself is harmless, and can be ignored.
"""

Comment 4 RHEL Program Management 2013-10-14 00:30:04 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 5 Marcel Kolaja 2014-02-27 19:02:05 UTC
The different outputs don't seem to be ppc64 specific only. The same behavior can be observed on x86_64:

[mkolaja@rhel6 ~]$ grep heap /proc/`pgrep emacs`/maps
02eb0000-02ed2000 rw-p 00000000 00:00 0                                  [heap]
[mkolaja@rhel6 ~]$ cat tmp/stderr 
data_size=38527784, cp=0x2ed1000, start=0xa12cd8
data_size=38531880, cp=0x2ed2000, start=0xa12cd8
[mkolaja@rhel6 ~]$ 

The reported value in "start=" is obtained from start_of_data() and is dependent on the DATA_START macro, which is defined differently for different architectures.

Comment 6 Marcel Kolaja 2014-03-15 14:14:37 UTC
DATA_START is undefined on x86_64, as well as ORDINARY_LINK, hence start_of_data() is:

# 1717 "sysdep.c"
char *
start_of_data ()
{
# 1734 "sysdep.c"
  extern int data_start;
  return ((char *) &data_start);


}

data_start is (pre-crt0.c):

int data_start = 0;

This does not, however, get allocated on the heap, so we can't expect the address to be within the heap range.

Comment 7 Marcel Kolaja 2014-03-16 10:53:10 UTC
The very same situation is on ppc64.

Comment 8 Marcel Kolaja 2014-03-16 14:22:45 UTC
the same for s390x

Comment 9 Marcel Kolaja 2014-03-16 16:14:34 UTC
There's a small difference on i686. The heap doesn't get allocated immediately when emacs starts, as it does on other architectures:

[root@athlon3 ~]# grep heap /proc/`pgrep emacs`/maps
[root@athlon3 ~]# 

But once it happens, it can be confirmed that the address reported in "start=" is not within the heap range either:

0a086000-0a2ac000 rw-p 00000000 00:00 0          [heap]

data_size=30657468, cp=0xa0a7000, start=0x836a444

Comment 10 Marcel Kolaja 2014-03-17 09:18:02 UTC
The macros are again defined the same on i686.

Comment 11 Marcel Kolaja 2014-03-17 12:51:50 UTC
The memory usage counting does not work correctly. I have extended the debugging output for two more variables to confirm that we're looking at the right limits:

  fprintf(stderr,"data_size=%lu, cp=%p, start=%p, lim_data=%lu, five_percent=%lu\n",
           data_size, cp, data_space_start, lim_data, five_percent);

Now, let's see what we get on x86_64. This is the ulimit settings:

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 7811
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1024
virtual memory          (kbytes, -v) 262144
file locks                      (-x) unlimited

When we run emacs, we get this on STDERR (the previously mentioned fprintf()):

data_size=32846568, cp=0x2966000, start=0xa12d18, lim_data=268435456, five_percent=13421772
data_size=32850664, cp=0x2967000, start=0xa12d18, lim_data=268435456, five_percent=13421772

This is the contents of /proc/<pid>/maps:

00400000-005fc000 r-xp 00000000 fd:00 677297                             /usr/bin/emacs-23.1
007fb000-010a3000 rw-p 001fb000 fd:00 677297                             /usr/bin/emacs-23.1
02945000-02967000 rw-p 00000000 00:00 0                                  [heap]
3727600000-3727612000 r-xp 00000000 fd:00 677179                         /usr/lib64/libotf.so.0.0.0
3727612000-3727812000 ---p 00012000 fd:00 677179                         /usr/lib64/libotf.so.0.0.0
3727812000-3727813000 rw-p 00012000 fd:00 677179                         /usr/lib64/libotf.so.0.0.0
3727a00000-3727a39000 r-xp 00000000 fd:00 677299                         /usr/lib64/libcroco-0.6.so.3.0.1
3727a39000-3727c39000 ---p 00039000 fd:00 677299                         /usr/lib64/libcroco-0.6.so.3.0.1
3727c39000-3727c3d000 rw-p 00039000 fd:00 677299                         /usr/lib64/libcroco-0.6.so.3.0.1
3728200000-372823b000 r-xp 00000000 fd:00 673695                         /usr/lib64/libgsf-1.so.114.0.15
372823b000-372843a000 ---p 0003b000 fd:00 673695                         /usr/lib64/libgsf-1.so.114.0.15
372843a000-372843f000 rw-p 0003a000 fd:00 673695                         /usr/lib64/libgsf-1.so.114.0.15
372843f000-3728440000 rw-p 00000000 00:00 0 
3728600000-3728610000 r-xp 00000000 fd:00 407817                         /lib64/libbz2.so.1.0.4
3728610000-372880f000 ---p 00010000 fd:00 407817                         /lib64/libbz2.so.1.0.4
372880f000-3728811000 rw-p 0000f000 fd:00 407817                         /lib64/libbz2.so.1.0.4
3729200000-3729211000 r-xp 00000000 fd:00 662491                         /usr/lib64/libXpm.so.4.11.0
3729211000-3729410000 ---p 00011000 fd:00 662491                         /usr/lib64/libXpm.so.4.11.0
3729410000-3729411000 rw-p 00010000 fd:00 662491                         /usr/lib64/libXpm.so.4.11.0
3729600000-372961e000 r-xp 00000000 fd:00 677196                         /usr/lib64/libatk-1.0.so.0.3009.1
372961e000-372981e000 ---p 0001e000 fd:00 677196                         /usr/lib64/libatk-1.0.so.0.3009.1
372981e000-3729821000 rw-p 0001e000 fd:00 677196                         /usr/lib64/libatk-1.0.so.0.3009.1
3729a00000-3729a08000 r-xp 00000000 fd:00 677307                         /usr/lib64/libm17n-flt.so.0.3.0
3729a08000-3729c08000 ---p 00008000 fd:00 677307                         /usr/lib64/libm17n-flt.so.0.3.0
3729c08000-3729c09000 rw-p 00008000 fd:00 677307                         /usr/lib64/libm17n-flt.so.0.3.0
3729e00000-3729e08000 r-xp 00000000 fd:00 657285                         /usr/lib64/libgif.so.4.1.6
3729e08000-372a008000 ---p 00008000 fd:00 657285                         /usr/lib64/libgif.so.4.1.6
372a008000-372a009000 rw-p 00008000 fd:00 657285                         /usr/lib64/libgif.so.4.1.6
372a200000-372a21e000 r-xp 00000000 fd:00 668854                         /usr/lib64/libm17n-core.so.0.3.0
372a21e000-372a41e000 ---p 0001e000 fd:00 668854                         /usr/lib64/libm17n-core.so.0.3.0
372a41e000-372a41f000 rw-p 0001e000 fd:00 668854                         /usr/lib64/libm17n-core.so.0.3.0
372a41f000-372a42b000 rw-p 00000000 00:00 0 
372a600000-372a61d000 r-xp 00000000 fd:00 392539                         /lib64/libtinfo.so.5.7
372a61d000-372a81d000 ---p 0001d000 fd:00 392539                         /lib64/libtinfo.so.5.7
372a81d000-372a821000 rw-p 0001d000 fd:00 392539                         /lib64/libtinfo.so.5.7
372aa00000-372aa22000 r-xp 00000000 fd:00 407882                         /lib64/libncurses.so.5.7
372aa22000-372ac21000 ---p 00022000 fd:00 407882                         /lib64/libncurses.so.5.7
372ac21000-372ac22000 rw-p 00021000 fd:00 407882                         /lib64/libncurses.so.5.7
372ae00000-372ae14000 r-xp 00000000 fd:00 677170                         /usr/lib64/libXft.so.2.3.1
372ae14000-372b014000 ---p 00014000 fd:00 677170                         /usr/lib64/libXft.so.2.3.1
372b014000-372b015000 rw-p 00014000 fd:00 677170                         /usr/lib64/libXft.so.2.3.1
3851c00000-3851c20000 r-xp 00000000 fd:00 392450                         /lib64/ld-2.12.so
3851e1f000-3851e20000 r--p 0001f000 fd:00 392450                         /lib64/ld-2.12.so
3851e20000-3851e21000 rw-p 00020000 fd:00 392450                         /lib64/ld-2.12.so
3851e21000-3851e22000 rw-p 00000000 00:00 0 
3852000000-385218b000 r-xp 00000000 fd:00 392453                         /lib64/libc-2.12.so
385218b000-385238a000 ---p 0018b000 fd:00 392453                         /lib64/libc-2.12.so
385238a000-385238e000 r--p 0018a000 fd:00 392453                         /lib64/libc-2.12.so
385238e000-385238f000 rw-p 0018e000 fd:00 392453                         /lib64/libc-2.12.so
385238f000-3852394000 rw-p 00000000 00:00 0 
3852400000-3852402000 r-xp 00000000 fd:00 392459                         /lib64/libdl-2.12.so
3852402000-3852602000 ---p 00002000 fd:00 392459                         /lib64/libdl-2.12.so
3852602000-3852603000 r--p 00002000 fd:00 392459                         /lib64/libdl-2.12.so
3852603000-3852604000 rw-p 00003000 fd:00 392459                         /lib64/libdl-2.12.so
3852800000-3852817000 r-xp 00000000 fd:00 392454                         /lib64/libpthread-2.12.so
3852817000-3852a17000 ---p 00017000 fd:00 392454                         /lib64/libpthread-2.12.so
3852a17000-3852a18000 r--p 00017000 fd:00 392454                         /lib64/libpthread-2.12.so
3852a18000-3852a19000 rw-p 00018000 fd:00 392454                         /lib64/libpthread-2.12.so
3852a19000-3852a1d000 rw-p 00000000 00:00 0 
3852c00000-3852c15000 r-xp 00000000 fd:00 392477                         /lib64/libz.so.1.2.3
3852c15000-3852e14000 ---p 00015000 fd:00 392477                         /lib64/libz.so.1.2.3
3852e14000-3852e15000 r--p 00014000 fd:00 392477                         /lib64/libz.so.1.2.3
3852e15000-3852e16000 rw-p 00015000 fd:00 392477                         /lib64/libz.so.1.2.3
3853000000-3853083000 r-xp 00000000 fd:00 392460                         /lib64/libm-2.12.so
3853083000-3853282000 ---p 00083000 fd:00 392460                         /lib64/libm-2.12.so
3853282000-3853283000 r--p 00082000 fd:00 392460                         /lib64/libm-2.12.so
3853283000-3853284000 rw-p 00083000 fd:00 392460                         /lib64/libm-2.12.so
3853400000-3853407000 r-xp 00000000 fd:00 392463                         /lib64/librt-2.12.so
3853407000-3853606000 ---p 00007000 fd:00 392463                         /lib64/librt-2.12.so
3853606000-3853607000 r--p 00006000 fd:00 392463                         /lib64/librt-2.12.so
3853607000-3853608000 rw-p 00007000 fd:00 392463                         /lib64/librt-2.12.so
3853800000-385381d000 r-xp 00000000 fd:00 392523                         /lib64/libselinux.so.1
385381d000-3853a1c000 ---p 0001d000 fd:00 392523                         /lib64/libselinux.so.1
3853a1c000-3853a1d000 r--p 0001c000 fd:00 392523                         /lib64/libselinux.so.1
3853a1d000-3853a1e000 rw-p 0001d000 fd:00 392523                         /lib64/libselinux.so.1
3853a1e000-3853a1f000 rw-p 00000000 00:00 0 
3853c00000-3853c16000 r-xp 00000000 fd:00 392522                         /lib64/libresolv-2.12.so
3853c16000-3853e16000 ---p 00016000 fd:00 392522                         /lib64/libresolv-2.12.so
3853e16000-3853e17000 r--p 00016000 fd:00 392522                         /lib64/libresolv-2.12.so
3853e17000-3853e18000 rw-p 00017000 fd:00 392522                         /lib64/libresolv-2.12.so
3853e18000-3853e1a000 rw-p 00000000 00:00 0 
3854000000-3854103000 r-xp 00000000 fd:00 392502                         /lib64/libglib-2.0.so.0.2600.1
3854103000-3854303000 ---p 00103000 fd:00 392502                         /lib64/libglib-2.0.so.0.2600.1
3854303000-3854304000 rw-p 00103000 fd:00 392502                         /lib64/libglib-2.0.so.0.2600.1
3854304000-3854305000 rw-p 00000000 00:00 0 
3854400000-3854440000 r-xp 00000000 fd:00 392484                         /lib64/libdbus-1.so.3.4.0
3854440000-385463f000 ---p 00040000 fd:00 392484                         /lib64/libdbus-1.so.3.4.0
385463f000-3854640000 r--p 0003f000 fd:00 392484                         /lib64/libdbus-1.so.3.4.0
3854640000-3854641000 rw-p 00040000 fd:00 392484                         /lib64/libdbus-1.so.3.4.0
3855800000-38558e4000 r-xp 00000000 fd:00 392483                         /lib64/libasound.so.2.0.0
38558e4000-3855ae3000 ---p 000e4000 fd:00 392483                         /lib64/libasound.so.2.0.0
3855ae3000-3855aeb000 rw-p 000e3000 fd:00 392483                         /lib64/libasound.so.2.0.0
3856000000-3856009000 r-xp 00000000 fd:00 657229                         /usr/lib64/libXcursor.so.1.0.2
3856009000-3856209000 ---p 00009000 fd:00 657229                         /usr/lib64/libXcursor.so.1.0.2
3856209000-385620a000 rw-p 00009000 fd:00 657229                         /usr/lib64/libXcursor.so.1.0.2
3856800000-385683f000 r-xp 00000000 fd:00 660823                         /usr/lib64/libjpeg.so.62.0.0
385683f000-3856a3f000 ---p 0003f000 fd:00 660823                         /usr/lib64/libjpeg.so.62.0.0
3856a3f000-3856a40000 rw-p 0003f000 fd:00 660823                         /usr/lib64/libjpeg.so.62.0.0
3856a40000-3856a50000 rw-p 00000000 00:00 0 
3856c00000-3856d0b000 r-xp 00000000 fd:00 392531                         /lib64/libgio-2.0.so.0.2600.1
3856d0b000-3856f0b000 ---p 0010b000 fd:00 392531                         /lib64/libgio-2.0.so.0.2600.1
3856f0b000-3856f10000 rw-p 0010b000 fd:00 392531                         /lib64/libgio-2.0.so.0.2600.1
3856f10000-3856f11000 rw-p 00000000 00:00 0 
3857400000-385744a000 r-xp 00000000 fd:00 392511                         /lib64/libgobject-2.0.so.0.2600.1
385744a000-3857649000 ---p 0004a000 fd:00 392511                         /lib64/libgobject-2.0.so.0.2600.1
3857649000-385764b000 rw-p 00049000 fd:00 392511                         /lib64/libgobject-2.0.so.0.2600.1
385764b000-385764c000 rw-p 00000000 00:00 0 
3857800000-3857804000 r-xp 00000000 fd:00 392505                         /lib64/libgthread-2.0.so.0.2600.1
3857804000-3857a03000 ---p 00004000 fd:00 392505                         /lib64/libgthread-2.0.so.0.2600.1
3857a03000-3857a04000 rw-p 00003000 fd:00 392505                         /lib64/libgthread-2.0.so.0.2600.1
3858000000-3858048000 r-xp 00000000 fd:00 657035                         /usr/lib64/libpango-1.0.so.0.2800.1
3858048000-3858248000 ---p 00048000 fd:00 657035                         /usr/lib64/libpango-1.0.so.0.2800.1
3858248000-385824b000 rw-p 00048000 fd:00 657035                         /usr/lib64/libpango-1.0.so.0.2800.1
3858400000-385841e000 r-xp 00000000 fd:00 657153                         /usr/lib64/libgdk_pixbuf-2.0.so.0.2000.1
385841e000-385861e000 ---p 0001e000 fd:00 657153                         /usr/lib64/libgdk_pixbuf-2.0.so.0.2000.1
385861e000-385861f000 rw-p 0001e000 fd:00 657153                         /usr/lib64/libgdk_pixbuf-2.0.so.0.2000.1
3858800000-3858829000 r-xp 00000000 fd:00 655473                         /usr/lib64/libpangoft2-1.0.so.0.2800.1
3858829000-3858a28000 ---p 00029000 fd:00 655473                         /usr/lib64/libpangoft2-1.0.so.0.2800.1
3858a28000-3858a2a000 rw-p 00028000 fd:00 655473                         /usr/lib64/libpangoft2-1.0.so.0.2800.1
3859400000-3859548000 r-xp 00000000 fd:00 667582                         /usr/lib64/libxml2.so.2.7.6
3859548000-3859747000 ---p 00148000 fd:00 667582                         /usr/lib64/libxml2.so.2.7.6
3859747000-3859751000 rw-p 00147000 fd:00 667582                         /usr/lib64/libxml2.so.2.7.6
3859751000-3859752000 rw-p 00000000 00:00 0 
3859800000-3859803000 r-xp 00000000 fd:00 392517                         /lib64/libgmodule-2.0.so.0.2600.1
3859803000-3859a02000 ---p 00003000 fd:00 392517                         /lib64/libgmodule-2.0.so.0.2600.1
3859a02000-3859a03000 rw-p 00002000 fd:00 392517                         /lib64/libgmodule-2.0.so.0.2600.1
385a000000-385a026000 r-xp 00000000 fd:00 392520                         /lib64/libexpat.so.1.5.2
385a026000-385a225000 ---p 00026000 fd:00 392520                         /lib64/libexpat.so.1.5.2
385a225000-385a228000 rw-p 00025000 fd:00 392520                         /lib64/libexpat.so.1.5.2
385a800000-385a804000 r-xp 00000000 fd:00 392532                         /lib64/libuuid.so.1.3.0
385a804000-385aa03000 ---p 00004000 fd:00 392532                         /lib64/libuuid.so.1.3.0
385aa03000-385aa04000 rw-p 00003000 fd:00 392532                         /lib64/libuuid.so.1.3.0
385b000000-385b098000 r-xp 00000000 fd:00 660831                         /usr/lib64/libfreetype.so.6.3.22
385b098000-385b297000 ---p 00098000 fd:00 660831                         /usr/lib64/libfreetype.so.6.3.22
385b297000-385b29d000 rw-p 00097000 fd:00 660831                         /usr/lib64/libfreetype.so.6.3.22
385b400000-385b434000 r-xp 00000000 fd:00 656651                         /usr/lib64/libfontconfig.so.1.4.4
385b434000-385b634000 ---p 00034000 fd:00 656651                         /usr/lib64/libfontconfig.so.1.4.4
385b634000-385b636000 rw-p 00034000 fd:00 656651                         /usr/lib64/libfontconfig.so.1.4.4
385b800000-385b825000 r-xp 00000000 fd:00 658561                         /usr/lib64/libpng12.so.0.49.0
385b825000-385ba25000 ---p 00025000 fd:00 658561                         /usr/lib64/libpng12.so.0.49.0
385ba25000-385ba26000 rw-p 00025000 fd:00 658561                         /usr/lib64/libpng12.so.0.49.0
385bc00000-385bc02000 r-xp 00000000 fd:00 660820                         /usr/lib64/libXau.so.6.0.0
385bc02000-385be02000 ---p 00002000 fd:00 660820                         /usr/lib64/libXau.so.6.0.0
385be02000-385be03000 rw-p 00002000 fd:00 660820                         /usr/lib64/libXau.so.6.0.0
385c000000-385c01d000 r-xp 00000000 fd:00 656403                         /usr/lib64/libxcb.so.1.1.0
385c01d000-385c21d000 ---p 0001d000 fd:00 656403                         /usr/lib64/libxcb.so.1.1.0
385c21d000-385c21e000 rw-p 0001d000 fd:00 656403                         /usr/lib64/libxcb.so.1.1.0
385c400000-385c537000 r-xp 00000000 fd:00 657020                         /usr/lib64/libX11.so.6.3.0
385c537000-385c737000 ---p 00137000 fd:00 657020                         /usr/lib64/libX11.so.6.3.0
385c737000-385c73d000 rw-p 00137000 fd:00 657020                         /usr/lib64/libX11.so.6.3.0
385c800000-385c809000 r-xp 00000000 fd:00 657023                         /usr/lib64/libXrender.so.1.3.0
385c809000-385ca09000 ---p 00009000 fd:00 657023                         /usr/lib64/libXrender.so.1.3.0
385ca09000-385ca0a000 rw-p 00009000 fd:00 657023                         /usr/lib64/libXrender.so.1.3.0
385cc00000-385cc12000 r-xp 00000000 fd:00 660828                         /usr/lib64/libXext.so.6.4.0
385cc12000-385ce12000 ---p 00012000 fd:00 660828                         /usr/lib64/libXext.so.6.4.0
385ce12000-385ce13000 rw-p 00012000 fd:00 660828                         /usr/lib64/libXext.so.6.4.0
385d000000-385d00e000 r-xp 00000000 fd:00 660176                         /usr/lib64/libXi.so.6.1.0
385d00e000-385d20e000 ---p 0000e000 fd:00 660176                         /usr/lib64/libXi.so.6.1.0
385d20e000-385d20f000 rw-p 0000e000 fd:00 660176                         /usr/lib64/libXi.so.6.1.0
385d400000-385d40a000 r-xp 00000000 fd:00 658752                         /usr/lib64/libXrandr.so.2.2.0
385d40a000-385d609000 ---p 0000a000 fd:00 658752                         /usr/lib64/libXrandr.so.2.2.0
385d609000-385d60a000 rw-p 00009000 fd:00 658752                         /usr/lib64/libXrandr.so.2.2.0
385d800000-385d805000 r-xp 00000000 fd:00 657338                         /usr/lib64/libXfixes.so.3.1.0
385d805000-385da05000 ---p 00005000 fd:00 657338                         /usr/lib64/libXfixes.so.3.1.0
385da05000-385da06000 rw-p 00005000 fd:00 657338                         /usr/lib64/libXfixes.so.3.1.0
385dc00000-385dc02000 r-xp 00000000 fd:00 660841                         /usr/lib64/libXinerama.so.1.0.0
385dc02000-385de01000 ---p 00002000 fd:00 660841                         /usr/lib64/libXinerama.so.1.0.0
385de01000-385de02000 rw-p 00001000 fd:00 660841                         /usr/lib64/libXinerama.so.1.0.0
385e400000-385e407000 r-xp 00000000 fd:00 660821                         /usr/lib64/libSM.so.6.0.1
385e407000-385e607000 ---p 00007000 fd:00 660821                         /usr/lib64/libSM.so.6.0.1
385e607000-385e608000 rw-p 00007000 fd:00 660821                         /usr/lib64/libSM.so.6.0.1
385e800000-385e817000 r-xp 00000000 fd:00 660856                         /usr/lib64/libICE.so.6.3.0
385e817000-385ea17000 ---p 00017000 fd:00 660856                         /usr/lib64/libICE.so.6.3.0
385ea17000-385ea18000 rw-p 00017000 fd:00 660856                         /usr/lib64/libICE.so.6.3.0
385ea18000-385ea1c000 rw-p 00000000 00:00 0 
385ec00000-385ec02000 r-xp 00000000 fd:00 660847                         /usr/lib64/libXdamage.so.1.1.0
385ec02000-385ee01000 ---p 00002000 fd:00 660847                         /usr/lib64/libXdamage.so.1.1.0
385ee01000-385ee02000 rw-p 00001000 fd:00 660847                         /usr/lib64/libXdamage.so.1.1.0
385f800000-385f802000 r-xp 00000000 fd:00 660844                         /usr/lib64/libXcomposite.so.1.0.0
385f802000-385fa01000 ---p 00002000 fd:00 660844                         /usr/lib64/libXcomposite.so.1.0.0
385fa01000-385fa02000 rw-p 00001000 fd:00 660844                         /usr/lib64/libXcomposite.so.1.0.0
39de400000-39de462000 r-xp 00000000 fd:00 702753                         /usr/lib64/libtiff.so.3.9.4
39de462000-39de661000 ---p 00062000 fd:00 702753                         /usr/lib64/libtiff.so.3.9.4
39de661000-39de664000 rw-p 00061000 fd:00 702753                         /usr/lib64/libtiff.so.3.9.4
39de800000-39de876000 r-xp 00000000 fd:00 674395                         /usr/lib64/libcairo.so.2.10800.8
39de876000-39dea76000 ---p 00076000 fd:00 674395                         /usr/lib64/libcairo.so.2.10800.8
39dea76000-39dea79000 rw-p 00076000 fd:00 674395                         /usr/lib64/libcairo.so.2.10800.8
39dec00000-39dec83000 r-xp 00000000 fd:00 667561                         /usr/lib64/libpixman-1.so.0.26.2
39dec83000-39dee82000 ---p 00083000 fd:00 667561                         /usr/lib64/libpixman-1.so.0.26.2
39dee82000-39dee88000 rw-p 00082000 fd:00 667561                         /usr/lib64/libpixman-1.so.0.26.2
39df000000-39df00b000 r-xp 00000000 fd:00 660838                         /usr/lib64/libpangocairo-1.0.so.0.2800.1
39df00b000-39df20b000 ---p 0000b000 fd:00 660838                         /usr/lib64/libpangocairo-1.0.so.0.2800.1
39df20b000-39df20c000 rw-p 0000b000 fd:00 660838                         /usr/lib64/libpangocairo-1.0.so.0.2800.1
39df400000-39df86a000 r-xp 00000000 fd:00 660849                         /usr/lib64/libgtk-x11-2.0.so.0.2000.1
39df86a000-39dfa69000 ---p 0046a000 fd:00 660849                         /usr/lib64/libgtk-x11-2.0.so.0.2000.1
39dfa69000-39dfa74000 rw-p 00469000 fd:00 660849                         /usr/lib64/libgtk-x11-2.0.so.0.2000.1
39dfa74000-39dfa76000 rw-p 00000000 00:00 0 
39dfc00000-39dfcb6000 r-xp 00000000 fd:00 655126                         /usr/lib64/libgdk-x11-2.0.so.0.2000.1
39dfcb6000-39dfeb6000 ---p 000b6000 fd:00 655126                         /usr/lib64/libgdk-x11-2.0.so.0.2000.1
39dfeb6000-39dfebb000 rw-p 000b6000 fd:00 655126                         /usr/lib64/libgdk-x11-2.0.so.0.2000.1
39e0000000-39e0037000 r-xp 00000000 fd:00 662579                         /usr/lib64/librsvg-2.so.2.26.0
39e0037000-39e0237000 ---p 00037000 fd:00 662579                         /usr/lib64/librsvg-2.so.2.26.0
39e0237000-39e0239000 rw-p 00037000 fd:00 662579                         /usr/lib64/librsvg-2.so.2.26.0
7fdc9e3ec000-7fdc9e49a000 rw-p 00000000 00:00 0 
7fdc9e49a000-7fdc9e4a6000 r-xp 00000000 fd:00 410010                     /lib64/libnss_files-2.12.so
7fdc9e4a6000-7fdc9e6a6000 ---p 0000c000 fd:00 410010                     /lib64/libnss_files-2.12.so
7fdc9e6a6000-7fdc9e6a7000 r--p 0000c000 fd:00 410010                     /lib64/libnss_files-2.12.so
7fdc9e6a7000-7fdc9e6a8000 rw-p 0000d000 fd:00 410010                     /lib64/libnss_files-2.12.so
7fdc9e6a8000-7fdca4539000 r--p 00000000 fd:00 685181                     /usr/lib/locale/locale-archive
7fdca4539000-7fdca4553000 rw-p 00000000 00:00 0 
7fdca4561000-7fdca4562000 rw-p 00000000 00:00 0 
7fffaa2cc000-7fffaa38f000 rw-p 00000000 00:00 0                          [stack]
7fffaa3ff000-7fffaa400000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

This is what ps reports as VSZ:

   VSZ
250524

We can see that data_space_start is in the following range:

007fb000-010a3000 rw-p 001fb000 fd:00 677297                             /usr/bin/emacs-23.1

And cp is the end of the heap:

02945000-02967000 rw-p 00000000 00:00 0                                  [heap]

The difference gives us data_size 2967000(hex) - a12d18(hex) = 32850664(dec). But VSZ is actually 256536576 (250524 * 1024) and we're actually getting very close to the ulimit (=lim_data = 268435456).

Comment 12 Marcel Kolaja 2014-03-17 15:48:51 UTC
With ppc64, we can see that memory mapping works differently:

10000000-10260000 r-xp 00000000 fd:00 143353                             /usr/bin/emacs-23.1
10260000-10b20000 rw-p 00260000 fd:00 143353                             /usr/bin/emacs-23.1
8058230000-8058260000 r-xp 00000000 fd:00 920731                         /lib64/ld-2.12.so
8058260000-8058270000 r--p 00020000 fd:00 920731                         /lib64/ld-2.12.so
8058270000-8058280000 rw-p 00030000 fd:00 920731                         /lib64/ld-2.12.so
8058280000-8058290000 r-xp 00000000 fd:00 920746                         /lib64/libgthread-2.0.so.0.2600.1
8058290000-80582a0000 rw-p 00000000 fd:00 920746                         /lib64/libgthread-2.0.so.0.2600.1
80582a0000-8058460000 r-xp 00000000 fd:00 920732                         /lib64/libc-2.12.so
8058460000-8058470000 r--p 001b0000 fd:00 920732                         /lib64/libc-2.12.so
8058470000-8058480000 rw-p 001c0000 fd:00 920732                         /lib64/libc-2.12.so
8058480000-8058490000 rw-p 00000000 00:00 0 
8058490000-80584a0000 r-xp 00000000 fd:00 920739                         /lib64/libdl-2.12.so
80584a0000-80584b0000 r--p 00000000 fd:00 920739                         /lib64/libdl-2.12.so
80584b0000-80584c0000 rw-p 00010000 fd:00 920739                         /lib64/libdl-2.12.so
80584c0000-80584e0000 r-xp 00000000 fd:00 920737                         /lib64/libpthread-2.12.so
80584e0000-80584f0000 r--p 00010000 fd:00 920737                         /lib64/libpthread-2.12.so
80584f0000-8058500000 rw-p 00020000 fd:00 920737                         /lib64/libpthread-2.12.so
8058500000-80585e0000 r-xp 00000000 fd:00 920733                         /lib64/libm-2.12.so
80585e0000-80585f0000 r--p 000d0000 fd:00 920733                         /lib64/libm-2.12.so
80585f0000-8058600000 rw-p 000e0000 fd:00 920733                         /lib64/libm-2.12.so
8058600000-8058620000 r-xp 00000000 fd:00 920734                         /lib64/libz.so.1.2.3
8058620000-8058630000 r--p 00010000 fd:00 920734                         /lib64/libz.so.1.2.3
8058630000-8058640000 rw-p 00020000 fd:00 920734                         /lib64/libz.so.1.2.3
8058640000-8058650000 r-xp 00000000 fd:00 920744                         /lib64/librt-2.12.so
8058650000-8058660000 r--p 00000000 fd:00 920744                         /lib64/librt-2.12.so
8058660000-8058670000 rw-p 00010000 fd:00 920744                         /lib64/librt-2.12.so
8058670000-80587d0000 r-xp 00000000 fd:00 920745                         /lib64/libglib-2.0.so.0.2600.1
80587d0000-80587e0000 rw-p 00160000 fd:00 920745                         /lib64/libglib-2.0.so.0.2600.1
80587e0000-8058810000 r-xp 00000000 fd:00 920749                         /lib64/libselinux.so.1
8058810000-8058820000 r--p 00020000 fd:00 920749                         /lib64/libselinux.so.1
8058820000-8058830000 rw-p 00030000 fd:00 920749                         /lib64/libselinux.so.1
8058830000-8058980000 r-xp 00000000 fd:00 917584                         /lib64/libasound.so.2.0.0
8058980000-80589a0000 rw-p 00140000 fd:00 917584                         /lib64/libasound.so.2.0.0
80589b0000-80589f0000 r-xp 00000000 fd:00 141182                         /usr/lib64/libpangoft2-1.0.so.0.2800.1
80589f0000-8058a00000 rw-p 00030000 fd:00 141182                         /usr/lib64/libpangoft2-1.0.so.0.2800.1
8058a00000-8058a70000 r-xp 00000000 fd:00 917620                         /lib64/libdbus-1.so.3.4.0
8058a70000-8058a80000 r--p 00060000 fd:00 917620                         /lib64/libdbus-1.so.3.4.0
8058a80000-8058a90000 rw-p 00070000 fd:00 917620                         /lib64/libdbus-1.so.3.4.0
8058a90000-8058b00000 r-xp 00000000 fd:00 920747                         /lib64/libgobject-2.0.so.0.2600.1
8058b00000-8058b10000 rw-p 00070000 fd:00 920747                         /lib64/libgobject-2.0.so.0.2600.1
8058b10000-8058b30000 r-xp 00000000 fd:00 917630                         /lib64/libresolv-2.12.so
8058b30000-8058b40000 r--p 00010000 fd:00 917630                         /lib64/libresolv-2.12.so
8058b40000-8058b50000 rw-p 00020000 fd:00 917630                         /lib64/libresolv-2.12.so
8058b50000-8058b90000 r-xp 00000000 fd:00 920735                         /lib64/libexpat.so.1.5.2
8058b90000-8058ba0000 rw-p 00030000 fd:00 920735                         /lib64/libexpat.so.1.5.2
8058ba0000-8058bf0000 r-xp 00000000 fd:00 133114                         /usr/lib64/libjpeg.so.62.0.0
8058bf0000-8058c00000 rw-p 00040000 fd:00 133114                         /usr/lib64/libjpeg.so.62.0.0
8058c00000-8058c10000 rw-p 00000000 00:00 0 
8058c10000-8058cd0000 r-xp 00000000 fd:00 132273                         /usr/lib64/libfreetype.so.6.3.22
8058cd0000-8058ce0000 rw-p 000c0000 fd:00 132273                         /usr/lib64/libfreetype.so.6.3.22
8058ce0000-8058d30000 r-xp 00000000 fd:00 132268                         /usr/lib64/libfontconfig.so.1.4.4
8058d30000-8058d40000 rw-p 00040000 fd:00 132268                         /usr/lib64/libfontconfig.so.1.4.4
8058d40000-8058d50000 r-xp 00000000 fd:00 920748                         /lib64/libuuid.so.1.3.0
8058d50000-8058d60000 rw-p 00000000 fd:00 920748                         /lib64/libuuid.so.1.3.0
8058d60000-8058d80000 r-xp 00000000 fd:00 920753                         /lib64/libbz2.so.1.0.4
8058d80000-8058d90000 rw-p 00010000 fd:00 920753                         /lib64/libbz2.so.1.0.4
8058d90000-8058db0000 r-xp 00000000 fd:00 133710                         /usr/lib64/libXext.so.6.4.0
8058db0000-8058dc0000 rw-p 00010000 fd:00 133710                         /usr/lib64/libXext.so.6.4.0
8058dc0000-8058dd0000 r-xp 00000000 fd:00 132327                         /usr/lib64/libSM.so.6.0.1
8058dd0000-8058de0000 rw-p 00000000 fd:00 132327                         /usr/lib64/libSM.so.6.0.1
8058de0000-8058df0000 r-xp 00000000 fd:00 133720                         /usr/lib64/libXfixes.so.3.1.0
8058df0000-8058e00000 rw-p 00000000 fd:00 133720                         /usr/lib64/libXfixes.so.3.1.0
8058e00000-8058e10000 r-xp 00000000 fd:00 133714                         /usr/lib64/libXrandr.so.2.2.0
8058e10000-8058e20000 rw-p 00000000 fd:00 133714                         /usr/lib64/libXrandr.so.2.2.0
8058e20000-8058e30000 r-xp 00000000 fd:00 133724                         /usr/lib64/libXinerama.so.1.0.0
8058e30000-8058e40000 rw-p 00000000 fd:00 133724                         /usr/lib64/libXinerama.so.1.0.0
8058e40000-8058e60000 r-xp 00000000 fd:00 137543                         /usr/lib64/libICE.so.6.3.0
8058e60000-8058e70000 rw-p 00020000 fd:00 137543                         /usr/lib64/libICE.so.6.3.0
8058e70000-8058e80000 r-xp 00000000 fd:00 133722                         /usr/lib64/libXcursor.so.1.0.2
8058e80000-8058e90000 rw-p 00000000 fd:00 133722                         /usr/lib64/libXcursor.so.1.0.2
8058e90000-8058ed0000 r-xp 00000000 fd:00 132282                         /usr/lib64/libpng12.so.0.49.0
8058ed0000-8058ee0000 rw-p 00030000 fd:00 132282                         /usr/lib64/libpng12.so.0.49.0
8058ee0000-8058ef0000 r-xp 00000000 fd:00 920758                         /lib64/libgmodule-2.0.so.0.2600.1
8058ef0000-8058f00000 rw-p 00000000 fd:00 920758                         /lib64/libgmodule-2.0.so.0.2600.1
8058f00000-8058f30000 r-xp 00000000 fd:00 920439                         /lib64/libtinfo.so.5.7
8058f30000-8058f40000 rw-p 00020000 fd:00 920439                         /lib64/libtinfo.so.5.7
8058f40000-8058f60000 r-xp 00000000 fd:00 133738                         /usr/lib64/libXft.so.2.3.1
8058f60000-8058f70000 rw-p 00010000 fd:00 133738                         /usr/lib64/libXft.so.2.3.1
8058f70000-8058fa0000 r-xp 00000000 fd:00 917669                         /lib64/libncurses.so.5.7
8058fa0000-8058fb0000 rw-p 00030000 fd:00 917669                         /lib64/libncurses.so.5.7
8058fb0000-8059020000 r-xp 00000000 fd:00 141249                         /usr/lib64/libpango-1.0.so.0.2800.1
8059020000-8059030000 rw-p 00060000 fd:00 141249                         /usr/lib64/libpango-1.0.so.0.2800.1
8059040000-80590c0000 r-xp 00000000 fd:00 135527                         /usr/lib64/libtiff.so.3.9.4
80590c0000-80590d0000 rw-p 00070000 fd:00 135527                         /usr/lib64/libtiff.so.3.9.4
80590d0000-8059280000 r-xp 00000000 fd:00 920763                         /lib64/libgio-2.0.so.0.2600.1
8059280000-80592a0000 rw-p 001b0000 fd:00 920763                         /lib64/libgio-2.0.so.0.2600.1
80592b0000-80592e0000 r-xp 00000000 fd:00 138942                         /usr/lib64/libgdk_pixbuf-2.0.so.0.2000.1
80592e0000-80592f0000 rw-p 00020000 fd:00 138942                         /usr/lib64/libgdk_pixbuf-2.0.so.0.2000.1
80592f0000-8059300000 r-xp 00000000 fd:00 136022                         /usr/lib64/libpangocairo-1.0.so.0.2800.1
8059300000-8059310000 rw-p 00010000 fd:00 136022                         /usr/lib64/libpangocairo-1.0.so.0.2800.1
8059310000-8059330000 r-xp 00000000 fd:00 141894                         /usr/lib64/libotf.so.0.0.0
8059330000-8059340000 rw-p 00010000 fd:00 141894                         /usr/lib64/libotf.so.0.0.0
8059340000-80593a0000 r-xp 00000000 fd:00 132263                         /usr/lib64/libcroco-0.6.so.3.0.1
80593a0000-80593b0000 rw-p 00050000 fd:00 132263                         /usr/lib64/libcroco-0.6.so.3.0.1
80593b0000-80593c0000 r-xp 00000000 fd:00 139182                         /usr/lib64/libXdamage.so.1.1.0
80593c0000-80593d0000 rw-p 00000000 fd:00 139182                         /usr/lib64/libXdamage.so.1.1.0
80593d0000-80593e0000 r-xp 00000000 fd:00 135321                         /usr/lib64/libXcomposite.so.1.0.0
80593e0000-80593f0000 rw-p 00000000 fd:00 135321                         /usr/lib64/libXcomposite.so.1.0.0
80593f0000-8059420000 r-xp 00000000 fd:00 133012                         /usr/lib64/libatk-1.0.so.0.3009.1
8059420000-8059430000 rw-p 00030000 fd:00 133012                         /usr/lib64/libatk-1.0.so.0.3009.1
8059430000-8059450000 r-xp 00000000 fd:00 142419                         /usr/lib64/libXpm.so.4.11.0
8059450000-8059460000 rw-p 00010000 fd:00 142419                         /usr/lib64/libXpm.so.4.11.0
8059460000-8059490000 r-xp 00000000 fd:00 133662                         /usr/lib64/libxcb.so.1.1.0
8059490000-80594a0000 rw-p 00020000 fd:00 133662                         /usr/lib64/libxcb.so.1.1.0
80594b0000-8059640000 r-xp 00000000 fd:00 133706                         /usr/lib64/libX11.so.6.3.0
8059640000-8059660000 rw-p 00180000 fd:00 133706                         /usr/lib64/libX11.so.6.3.0
8059660000-8059670000 r-xp 00000000 fd:00 132549                         /usr/lib64/libXau.so.6.0.0
8059670000-8059680000 rw-p 00000000 fd:00 132549                         /usr/lib64/libXau.so.6.0.0
8059680000-8059690000 r-xp 00000000 fd:00 133718                         /usr/lib64/libXrender.so.1.3.0
8059690000-80596a0000 rw-p 00000000 fd:00 133718                         /usr/lib64/libXrender.so.1.3.0
80596a0000-8059870000 r-xp 00000000 fd:00 139156                         /usr/lib64/libxml2.so.2.7.6
8059870000-8059890000 rw-p 001c0000 fd:00 139156                         /usr/lib64/libxml2.so.2.7.6
8059890000-8059910000 r-xp 00000000 fd:00 141186                         /usr/lib64/libpixman-1.so.0.26.2
8059910000-8059920000 rw-p 00080000 fd:00 141186                         /usr/lib64/libpixman-1.so.0.26.2
8059930000-8059950000 r-xp 00000000 fd:00 133712                         /usr/lib64/libXi.so.6.1.0
8059950000-8059960000 rw-p 00010000 fd:00 133712                         /usr/lib64/libXi.so.6.1.0
8059960000-8059a10000 r-xp 00000000 fd:00 136020                         /usr/lib64/libcairo.so.2.10800.8
8059a10000-8059a20000 rw-p 000a0000 fd:00 136020                         /usr/lib64/libcairo.so.2.10800.8
8059a20000-8059b20000 r-xp 00000000 fd:00 133734                         /usr/lib64/libgdk-x11-2.0.so.0.2000.1
8059b20000-8059b40000 rw-p 000f0000 fd:00 133734                         /usr/lib64/libgdk-x11-2.0.so.0.2000.1
8059b40000-805a180000 r-xp 00000000 fd:00 141247                         /usr/lib64/libgtk-x11-2.0.so.0.2000.1
805a180000-805a1e0000 rw-p 00640000 fd:00 141247                         /usr/lib64/libgtk-x11-2.0.so.0.2000.1
805a1e0000-805a230000 r-xp 00000000 fd:00 141184                         /usr/lib64/librsvg-2.so.2.26.0
805a230000-805a240000 rw-p 00040000 fd:00 141184                         /usr/lib64/librsvg-2.so.2.26.0
805a250000-805a2b0000 r-xp 00000000 fd:00 141452                         /usr/lib64/libgsf-1.so.114.0.15
805a2b0000-805a2c0000 rw-p 00060000 fd:00 141452                         /usr/lib64/libgsf-1.so.114.0.15
805a2c0000-805a2d0000 r-xp 00000000 fd:00 144335                         /usr/lib64/libgif.so.4.1.6
805a2d0000-805a2e0000 rw-p 00000000 fd:00 144335                         /usr/lib64/libgif.so.4.1.6
805a2e0000-805a310000 r-xp 00000000 fd:00 132341                         /usr/lib64/libm17n-core.so.0.3.0
805a310000-805a320000 rw-p 00030000 fd:00 132341                         /usr/lib64/libm17n-core.so.0.3.0
805a330000-805a340000 r-xp 00000000 fd:00 140854                         /usr/lib64/libm17n-flt.so.0.3.0
805a340000-805a350000 rw-p 00000000 fd:00 140854                         /usr/lib64/libm17n-flt.so.0.3.0
1000cad0000-1000cb10000 rw-p 00000000 00:00 0                            [heap]
fff804a0000-fff80560000 rw-p 00000000 00:00 0 
fff80560000-fff80570000 r-xp 00000000 fd:00 917534                       /lib64/libnss_files-2.12.so
fff80570000-fff80580000 r--p 00000000 fd:00 917534                       /lib64/libnss_files-2.12.so
fff80580000-fff80590000 rw-p 00010000 fd:00 917534                       /lib64/libnss_files-2.12.so
fff80590000-fff86780000 r--p 00000000 fd:00 131895                       /usr/lib/locale/locale-archive
fff86780000-fff86790000 rw-p 00000000 00:00 0 
fff867a0000-fff867c0000 r-xp 00000000 00:00 0                            [vdso]
fffdd310000-fffdd460000 rw-p 00000000 00:00 0                            [stack]

We get this on STDERR:

data_size=1099451308048, cp=0x1000cb10000, start=0x104967f0, lim_data=268435456, five_percent=13421772

This again matches the expected addresses for data_space_start:

10260000-10b20000 rw-p 00260000 fd:00 143353                             /usr/bin/emacs-23.1

And cp:

1000cad0000-1000cb10000 rw-p 00000000 00:00 0                            [heap]

As one can see, the difference between data_space_start and the end of the heap is huge, which leads to a completely opposite result. data_size is mistakenly 1099451308048, while VSZ is much less:

   VSZ
147968

The ulimit is set:

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 14565
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 14565
virtual memory          (kbytes, -v) 262144
file locks                      (-x) unlimited

The huge number in 1099451308048 then causes that we get the following warning:

Emergency (alloc): Warning: past 95% of memory limit

Comment 13 Marcel Kolaja 2014-03-19 16:47:50 UTC
Created attachment 876428 [details]
POC of a possible approach to fix the feature

We can either remove the feature or fix it by reading VmSize from /proc/self/status. Attaching a POC.

Comment 38 errata-xmlrpc 2015-02-19 12:27:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0238.html


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