Changeset 12893


Ignore:
Timestamp:
Sep 28, 2009, 11:22:36 PM (10 years ago)
Author:
gz
Message:

Add a percentage column to heap-utilization output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/lib/misc.lisp

    r12712 r12893  
    965965  (let* ((total-cons-size  (* nconses target::cons.size))
    966966         (total-vector-size 0)
    967          (total-physical-vector-size 0))
    968     (format out "~&Object type~42tCount~50tTotal Size in Bytes~72tTotal Size")
    969     (format out "~&CONS~36t~12d~48t~16d~16d" nconses total-cons-size total-cons-size)
     967         (total-physical-vector-size 0)
     968         (total-size 0))
     969    (format out "~&Object type~42tCount~50tTotal Size in Bytes~72tTotal Size~82t % of Heap")
     970    (dotimes( i (length nvectors))
     971      (incf total-vector-size (aref vector-sizes i))
     972      (incf total-physical-vector-size (aref vector-physical-sizes i)))
     973    (setq total-size (+ total-cons-size total-physical-vector-size))
     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)))
    970976    (dotimes (i (length nvectors))
    971       (let* ((count (aref nvectors i))
    972              (sizes (aref vector-sizes i))
    973              (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)))
    974980        (unless (zerop count)
    975           (incf total-vector-size sizes)
    976           (incf total-physical-vector-size psizes)
    977           (format out "~&~a~36t~12d~48t~16d~16d" (aref *heap-utilization-vector-type-names* i)  count sizes psizes))))
     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))))))
    978985    (format out "~&   Total sizes: ~49t~16d~16d" (+ total-cons-size total-vector-size) (+ total-cons-size total-physical-vector-size))))
    979986                           
Note: See TracChangeset for help on using the changeset viewer.