clojurescript 2025-02-21

Is there anything like clj-memory-meter for ClojureScript? https://github.com/clojure-goes-fast/clj-memory-meter I’m trying to use the chrome dev tools but am getting lost in the thousands of objects there, and all the different concepts, when all I want to do is to see how much memory a particular data structure I have consumes over some usage.

👀 1

You can use Memory tab in chrome dev tools to take heap snapshot and inspect it

I’ll send you an example in a bit

🙏 1

Thanks. That’s what I have been trying to use, but where I get lost. An example would be awesome.

Yeah, it’s a lot! But if I know how to find my datastructure of interest in there I could probably make do. clj-memory-meter seems so exactly like what I want. 😃 I wonder if it would be possible to create something similar…

You can put your values in some global property and then find it in a snapshot under window object window.MYDATA = myvalue

🙏 1

I also have a Node playground here https://github.com/roman01la/js-memory-usage But not sure if it will run since it’s fairly old

Sweet! I will check out.