roxen.lists.pike.general

Subject Author Date
Re: Real memory size of an array Bertrand LUPART <bertrand[dot]lupart[at]linkeo[dot]com> 24-09-2009
Martin Stjernholm <<mast[at]lysator.liu.se>> wrote:

> <bertrand.lupart[at]linkeo.com> (Bertrand LUPART) wrote:
> 
> > I'm looking for a way to know the real memory size (eg bytes) for an
> > array but can't find any. Is there a simple way to do that?
> 
> Take a look at Pike.count_memory (new in 7.8).

https://extranet.roxen.com/support/docs/refdoc-5.0/ex/predef_3A_3A/Pike/
count_memory.html

> array a = ({ ([ "foo":random_string(1024), "bar":random_string(2048) ]) });
> Pike.count_memory(0,a);
> (1) Result: 3538

Nice, thank you.

-- 
Bertrand LUPART

http://bertrand.gotpike.org/