Re: Memory de-allocation question
- Posted by xecronix 3 weeks ago
- 181 views
As yet, Phix never actually returns any memory to the OS except at program termination, though I doubt that's really an issue...
I think it does matter for my use case. BZScript currently builds several large intermediates before execution (file chars -> grouped tokens -> full AST). Once execution starts, those early structures are dead weight. By my rough estimate I could be holding up to ~30x the source size in transient data at peak, plus thousands of small short-lived chunks. Phix will reuse those, which is good, but the peak still sets a high-water mark in the process.
Takeaway: I need to rework the front end to stream and reuse buffers so only the final AST and symbols survive. Your note helped me catch this before it bites. Thanks.