Arc Forumnew | comments | leaders | submitlogin
Size of a list or table
1 point by shader 5415 days ago | 1 comment
How would you calculate the size in memory of an object in arc, such as a table, list or string? i.e.:

  arc> (size fns*)
  2019501
It's not really important, but would be very interesting.


1 point by conanite 5413 days ago | link

If there's a way to restrict the memory used by the mzscheme process, you could set an upper limit, and then

  (with (things nil n 0)
    (while t
      (prn (++ n))
      (push (new-thing) things))) ; not tested!
and wait for it to die. You won't have the memory size in bytes of each thing, but at least you know how many fit in your process, and that might be the more important number depending on your purpose.

-----