D.Cook
Member
I have a persistent batch procedure that seems to grow in memory over time, and am having a hard time determining the cause. Generally I've always thought the AVM handled memory pretty well, and after reviewing the code I cannot find any glaring problems:
I'm not experienced with memory management and don't really understand any of the memory metrics on Windows or UNIX..
So my question is, does anyone have any suggestions on where to look in the code, or how to maintain good memory usage? Aside from restarting the AVM periodically?
- Most logic is encapsulated in sub-procedures which have locally defined variables, so should be cleaned up when the sub-procedure completes.
- Temp-tables are maintained and cleaned appropriately.
- Memptrs are used, but I have ensured that they are unallocated (set-size(mptr) = 0) after every operation.
- I've tried changing the startup parameter -Bt (temp-table buffers) but it doesn't seem to have any effect.
- Some persistent procedures are maintained for performing their respective functions, but when the procedure instance is deleted, there is no memory freed up. Then when I run more functions, the memory continues to grow (I thought maybe it would re-use allocated memory)
I'm not experienced with memory management and don't really understand any of the memory metrics on Windows or UNIX..
So my question is, does anyone have any suggestions on where to look in the code, or how to maintain good memory usage? Aside from restarting the AVM periodically?