Changeset 12716
- Timestamp:
- Aug 29, 2009, 12:38:20 PM (15 years ago)
- File:
-
- 1 edited
-
branches/working-0711/ccl/library/leaks.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/working-0711/ccl/library/leaks.lisp
r12711 r12716 283 283 (ccl::rref mallinfo :mallinfo.uordblks))) 284 284 285 #|| 286 http://www.gnu.org/s/libc/manual/html_node/Statistics-of-Malloc.html 287 288 int arena 289 This is the total size of memory allocated with sbrk by malloc, in bytes. 290 int ordblks 291 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.) 292 int smblks 293 This field is unused. 294 int hblks 295 This is the total number of chunks allocated with mmap. 296 int hblkhd 297 This is the total size of memory allocated with mmap, in bytes. 298 int usmblks 299 This field is unused. 300 int fsmblks 301 This field is unused. 302 int uordblks 303 This is the total size of memory occupied by chunks handed out by malloc. 304 int fordblks 305 This is the total size of memory occupied by free (not in use) chunks. 306 int keepcost 307 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). 308 ||# 309 310 (defun show-malloc-info () 311 (rlet ((info :mallinfo)) 312 (#_mallinfo info) ;struct return invisible arg. 313 (let* ((arena (pref info :mallinfo.arena)) 314 (ordblks (pref info :mallinfo.ordblks)) 315 (hblks (pref info :mallinfo.hblks)) 316 (hblkhd (pref info :mallinfo.hblkhd)) 317 (uordblks (pref info :mallinfo.uordblks)) 318 (fordblks (pref info :mallinfo.fordblks)) 319 (keepcost (pref info :mallinfo.keepcost))) 320 (format t "~& arena size: ~d/#x~x" arena arena) 321 (format t "~& number of unused chunks = ~d" ordblks) 322 (format t "~& number of mmap'ed chunks = ~d" hblks) 323 (format t "~& total size of mmap'ed chunks = ~d/#x~x" hblkhd hblkhd) 324 (format t "~& total size of malloc'ed chunks = ~d/#x~x" uordblks uordblks) 325 (format t "~& total size of free chunks = ~d/#x~x" fordblks fordblks) 326 (format t "~& size of releaseable chunk = ~d/#x~x" keepcost keepcost)))) 327 285 328 ) ;; end of linux-only code
Note:
See TracChangeset
for help on using the changeset viewer.
