help with memory (sage)

30 views
Skip to first unread message

ayan.mah...@gmail.com

unread,
Jun 19, 2023, 6:10:49 AMJun 19
to sage-support
Hello All,
I have written a program. That takes as input an integer. Produces something. Not relevant. When the input is 15, the program works fine with memory usage 3.8% and steady.

When I increase the input to 25, memory usage increases. That is expected. But what is unexpected is that the memory usage keeps increasing and eventually it will max out and sage will get killed. I couldn't found much help online. The memory usage should not be that high.

Another crazy thing is that suppose I see 40% usage in memory and kill the program by cntrl-c but keep sage running. Then I start a new process in sage. The memory increases from 40%. As if there is some permanent stuff stored in the memory that can only be erased by shutting down sage.

The program that I am talking about is just few loops. Nothing that serious.

Thanks in advance,
Ayan

Marc Culler

unread,
Jun 19, 2023, 9:16:53 AMJun 19
to sage-support
You need to provide your code.  Of course it is relevant to know what is in those few loops.

- Marc

Nils Bruin

unread,
Jun 20, 2023, 11:28:15 AMJun 20
to sage-support
On Monday, 19 June 2023 at 12:10:49 UTC+2 ayan.mah...@gmail.com wrote:

Another crazy thing is that suppose I see 40% usage in memory and kill the program by cntrl-c but keep sage running. Then I start a new process in sage. The memory increases from 40%. As if there is some permanent stuff stored in the memory that can only be erased by shutting down sage.

It's most definitely the case that partial results from your interrupted run are reachable from active scopes and therefore their memory remains allocated.  Shutting down sage will most certainly release the memory, but if you can trace where it old results are still referenced, you could break those references and the memory would be released. These things can be hard to track down, particularly when you've interrupted code and hence may have left data structures in inconsistent states.


 
Reply all
Reply to author
Forward
0 new messages