Changeset 12938
- Timestamp:
- Oct 9, 2009, 7:18:15 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/source/library/leaks.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/library/leaks.lisp
r11373 r12938 266 266 (ccl::rref mallinfo :mallinfo.uordblks))) 267 267 268 #|| 269 http://www.gnu.org/s/libc/manual/html_node/Statistics-of-Malloc.html 270 271 int arena 272 This is the total size of memory allocated with sbrk by malloc, in bytes. 273 int ordblks 274 This is the number of chunks not in use. (The memory allocator internally gets chunks of memory from the operating system, and then carves them up to satisfy individual malloc requests; see Efficiency and Malloc.) 275 int smblks 276 This field is unused. 277 int hblks 278 This is the total number of chunks allocated with mmap. 279 int hblkhd 280 This is the total size of memory allocated with mmap, in bytes. 281 int usmblks 282 This field is unused. 283 int fsmblks 284 This field is unused. 285 int uordblks 286 This is the total size of memory occupied by chunks handed out by malloc. 287 int fordblks 288 This is the total size of memory occupied by free (not in use) chunks. 289 int keepcost 290 This is the size of the top-most releasable chunk that normally borders the end of the heap (i.e., the high end of the virtual address space's data segment). 291 ||# 292 293 (defun show-malloc-info () 294 (rlet ((info :mallinfo)) 295 (#_mallinfo info) ;struct return invisible arg. 296 (let* ((arena (pref info :mallinfo.arena)) 297 (ordblks (pref info :mallinfo.ordblks)) 298 (hblks (pref info :mallinfo.hblks)) 299 (hblkhd (pref info :mallinfo.hblkhd)) 300 (uordblks (pref info :mallinfo.uordblks)) 301 (fordblks (pref info :mallinfo.fordblks)) 302 (keepcost (pref info :mallinfo.keepcost))) 303 (format t "~& arena size: ~d/#x~x" arena arena) 304 (format t "~& number of unused chunks = ~d" ordblks) 305 (format t "~& number of mmap'ed chunks = ~d" hblks) 306 (format t "~& total size of mmap'ed chunks = ~d/#x~x" hblkhd hblkhd) 307 (format t "~& total size of malloc'ed chunks = ~d/#x~x" uordblks uordblks) 308 (format t "~& total size of free chunks = ~d/#x~x" fordblks fordblks) 309 (format t "~& size of releaseable chunk = ~d/#x~x" keepcost keepcost)))) 310 268 311 ) ;; end of linux-only code
Note:
See TracChangeset
for help on using the changeset viewer.
