Taaitaaiger / jlrs

Julia bindings for Rust
MIT License
408 stars 21 forks source link

Exorbitantly High Memory usage ? #109

Open nabeel99 opened 11 months ago

nabeel99 commented 11 months ago

Not sure if its a bug in my usage of jlrs or what, but if you monitor memory usage on the mac it goes up to some crazy number like 80gb and there have been instances where my macbook has restarted due to it running out of memory ? is there a common fallacy causing it something i am doing wrong ? am just using the sync r-t to call into some julia code.

Taaitaaiger commented 11 months ago

Data rooted in a frame remains rooted until you leave the scope that roots it and that will prevent the GC from freeing it. If you run into OOM errors, I expect you keep a single scope alive and use its frame to root all data.