Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Clojure how can I tell how much memory a ref uses in total?

Tags:

clojure

I want to start determining the memory requirements of my refs and how they grow with application usage. How can I do this?

like image 368
yazz.com Avatar asked Dec 17 '22 15:12

yazz.com


1 Answers

Someone asked about this on the mailing list a while ago (and probably someone else before that, and...). A few people provided utilities that kinda-sorta do what you might want, but I still prefer my answer: you can't do this in a language with such pervasive and automatic structural sharing. How do you calculate the size of a large object that you have two pointers to, etc etc.

like image 80
amalloy Avatar answered Jan 12 '23 00:01

amalloy