[Openmcl-devel] Checking ivector space use
Jon S. Anthony
j-anthony at comcast.net
Mon Mar 15 11:35:15 PDT 2010
On Mon, 2010-03-15 at 13:00 -0400, R. Matthew Emerson wrote:
> On Mar 15, 2010, at 11:13 AM, Jon S. Anthony wrote:
>
> > Is there any "standard" way to check up on ivector (which I suppose
> > really means foreign memory) use?
>
> I assume you mean heap-ivectors, as created by MAKE-HEAP-IVECTOR. (An ivector is a type of uvector that contains only immediate data.) These heap-ivectors reside in memory allocated via malloc, so any tools you have that can tell you about the malloc heap would apply.
>
> > I tried room, heap-utilization, and
> > time, and none report anything about this. Since the GC pays no
> > attention to this stuff, that makes some sense. But maybe there's
> > something I'm missing.
>
> I don't think there is anything specifically for that. Presumably something could walk ccl::*heap-ivectors* and figure something out...
>
> [hacks for a while]
>
> Update to r13533 and try CCL::HEAP-IVECTOR-UTILIZATION.
>
Works Great! Thanks!
$ ccl
Welcome to Clozure Common Lisp Version 1.5-dev-r13533M-trunk
(LinuxX8632)!
? (defun make-page-vector (size)
#+ccl
(multiple-value-bind (vector pointer)
(ccl:make-heap-ivector size '(unsigned-byte 8))
(list pointer vector)))
MAKE-PAGE-VECTOR
? (CCL::HEAP-IVECTOR-UTILIZATION)
Object type Count Logical size Physical size
% of Heap
(in bytes) (in bytes)
SIMPLE-UNSIGNED-BYTE-VECTOR 3 189 228
100.00%
Total 3 189 228
100.00%
? (let ((mem))
(dotimes (i 20)
(push (make-page-vector (* 8 (* 1024 1024))) mem))
mem)
((#<A Foreign Pointer #xB5F02014> #<VECTOR 8388608 type (UNSIGNED-BYTE
8), simple>) ...
...
? (CCL::HEAP-IVECTOR-UTILIZATION)
Object type Count Logical size Physical size
% of Heap
(in bytes) (in bytes)
SIMPLE-UNSIGNED-BYTE-VECTOR 23 167772349 167772648
100.00%
Total 23 167772349 167772648
100.00%
/Jon
More information about the Openmcl-devel
mailing list