English 中文(简体)
哪里是“差距”?
原标题:Where is the "heap"?

I just want to know where is (if present!) the Heap of my bash process (pid = 16457) in the result of cat /proc/16457/maps

0078a000-007a0000 r-xp 00000000 08:02 1319336    /lib/ld-2.3.4.so
007a0000-007a1000 r--p 00015000 08:02 1319336    /lib/ld-2.3.4.so
007a1000-007a2000 rw-p 00016000 08:02 1319336    /lib/ld-2.3.4.so
007a9000-008cf000 r-xp 00000000 08:02 1384495    /lib/tls/libc-2.3.4.so
008cf000-008d1000 r--p 00125000 08:02 1384495    /lib/tls/libc-2.3.4.so
008d1000-008d3000 rw-p 00127000 08:02 1384495    /lib/tls/libc-2.3.4.so
008d3000-008d5000 rw-p 008d3000 00:00 0
008fc000-008fe000 r-xp 00000000 08:02 1319337    /lib/libdl-2.3.4.so
008fe000-008ff000 r--p 00001000 08:02 1319337    /lib/libdl-2.3.4.so
008ff000-00900000 rw-p 00002000 08:02 1319337    /lib/libdl-2.3.4.so
00b27000-00b2a000 r-xp 00000000 08:02 278109     /lib/libtermcap.so.2.0.8
00b2a000-00b2b000 rw-p 00002000 08:02 278109     /lib/libtermcap.so.2.0.8
08047000-080d8000 r-xp 00000000 08:02 902412     /bin/bash
080d8000-080de000 rw-p 00090000 08:02 902412     /bin/bash
080de000-080e3000 rw-p 080de000 00:00 0
09ceb000-09d25000 rw-p 09ceb000 00:00 0
b7d99000-b7d9b000 rw-p b7d99000 00:00 0
b7d9b000-b7da1000 r--s 00000000 08:02 130808     /usr/lib/gconv/gconv-modules.cache
b7da1000-b7dd6000 r--s 00000000 08:02 869910     /var/db/nscd/passwd
b7dd6000-b7fd6000 r--p 00000000 08:02 101088     /usr/lib/locale/locale-archive
b7fd6000-b7fd8000 rw-p b7fd6000 00:00 0
bff07000-c0000000 rw-p bff07000 00:00 0
ffffe000-fffff000 r-xp 00000000 00:00 0
最佳回答

“大多数人都这样说:

080de000-080e3000 rw-p 080de000 00:00 0

i.e. 它把按<代码>brk制作的和可扩展的记忆区推到主要节目之后。

还可以将下列内容视为“差距”的一部分:

09ceb000-09d25000 rw-p 09ceb000 00:00 0

It seems to be an anonymous mapping created by mmap to service a large malloc request. Most malloc implementations use mmap for large requests so they can munmap it on free and return the whole block of memory to the OS. It also makes calloc much faster since you re guaranteed to get per-zeroed pages this way.

问题回答

现有六氯环己烷版本中的“[heap]”明显标明。 你的列名没有显示。 您是否确信,在把这个问题抄送你问时,你没有意外地加以切断?

我的伤口:

~% grep  [heap  /proc/$$/maps
00bca000-00d2e000 rw-p 00000000 00:00 0                                  [heap]

通常情况下,当有人打电话时,这种差距似乎有[差距]的标志;然而,你注意到,如果你用多条小型(小型)代码不断拉大,范围不会增长;然而,将产生新的空白条目。





相关问题
Fastest method for running a binary search on a file in C?

For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

Encoding, decoding an integer to a char array

Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array? I was looking for an answer but didn t get any satisfactory answer in the ...