Changeset 12936


Ignore:
Timestamp:
Oct 9, 2009, 2:14:40 PM (10 years ago)
Author:
gz
Message:

Add a percentage column to heap-utilization output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/misc.lisp

    r12888 r12936  
    964964  (let* ((total-cons-size  (* nconses target::cons.size))
    965965         (total-vector-size 0)
    966          (total-physical-vector-size 0))
    967     (format out "~&Object type~40tCount~48tTotal Size in Bytes~70tTotal Size")
    968     (format out "~&CONS~34t~12d~46t~16d~16d" nconses total-cons-size total-cons-size)
     966         (total-physical-vector-size 0)
     967         (total-size 0))
     968    (format out "~&Object type~42tCount~50tTotal Size in Bytes~72tTotal Size~82t % of Heap")
     969    (dotimes( i (length nvectors))
     970      (incf total-vector-size (aref vector-sizes i))
     971      (incf total-physical-vector-size (aref vector-physical-sizes i)))
     972    (setq total-size (+ total-cons-size total-physical-vector-size))
     973    (unless (zerop nconses)
     974      (format out "~&CONS~36t~12d~48t~16d~16d~8,2f%" nconses total-cons-size total-cons-size
     975              (* 100 (/ total-cons-size total-size))))
    969976    (dotimes (i (length nvectors))
    970       (let* ((count (aref nvectors i))
    971              (sizes (aref vector-sizes i))
    972              (psizes (aref vector-physical-sizes i)))
     977      (let ((count (aref nvectors i))
     978            (sizes (aref vector-sizes i))
     979            (psizes (aref vector-physical-sizes i)))
    973980        (unless (zerop count)
    974           (incf total-vector-size sizes)
    975           (incf total-physical-vector-size psizes)
    976           (format out "~&~a~34t~12d~46t~16d~16d" (aref *heap-utilization-vector-type-names* i)  count sizes psizes))))
    977     (format out "~&   Total sizes: ~47t~16d~16d" (+ total-cons-size total-vector-size) (+ total-cons-size total-physical-vector-size))))
    978                            
     981          (format out "~&~a~36t~12d~48t~16d~16d~8,2f%"
     982                  (aref *heap-utilization-vector-type-names* i)
     983                  count sizes psizes
     984                  (* 100.0 (/ psizes total-size))))))
     985    (format out "~&   Total sizes: ~49t~16d~16d" (+ total-cons-size total-vector-size) (+ total-cons-size total-physical-vector-size))))
     986
    979987;; The number of words to allocate for static conses when the user requests
    980988;; one and we don't have any left over
Note: See TracChangeset for help on using the changeset viewer.