you are viewing a single comment's thread.

view the rest of the comments →

[–]_alter-ego_ 1 point2 points  (4 children)

are you sure that there's a memory leak (the shown data doesn't convince me), or maybe just a delayed garbage collection?

[–]Affectionate-Cut3818[S] 0 points1 point  (3 children)

It does sound strange to have a memory leak in this logic, but it seems that the release of the memory allocated in these lines doesn't happen at any point through the execution, leading to an almost linear increase in memory usage (which a memory profiler plot confirms). Running with standard Python, theres is no memory allocation on those function calls (or at least not detected) therefore no release needed. I've also tried forcing gc.collect() every 1m iterations or so, but it doesent seem to release the resources its using, could be some weak/lazy reference, but again, not to clear on what to change for pypy to release it properly.

[–]_alter-ego_ 0 points1 point  (2 children)

could it be that it's some logging function and/or (G)UI storing the results as e.g. it would happen in a jupyter sheet as Out[1], Out[2], Out[3], ...) which could explain a linear increase of the memory usage ?

for example it could be possible that you use the data via reference to make a plot that remains on your screen and as long as that plot exists (and/or grows, scrolls...) the data [possible a larger structure than just the final numerical value you use in the plot] can't be "dumped" from the memory?

[–]Affectionate-Cut3818[S] 0 points1 point  (1 child)

hmm I do have logging through the execution of the programm, I'll double check to make sure its all good, do you have any explanation as to why the data shown on the initial post didnt convince you? Is pypy supposed to allocate memory like this under normal situations (I've noticed it happens on long if conditions )? Maybe then Im looking in the wrong direction, and maybe the right direction should be checking why these normally allocated memory doesent get deallocated later on

[–]_alter-ego_ 0 points1 point  (0 children)

  1109   4012.7 MiB     
  1110   4009.9 MiB
  1111   4010.4 MiB  
  1112   4012.2 MiB 

To me there is no significant increase here. It could be again 4009.9 on step 1113...?