You are not logged in.
I experienced this twice already and I'm not sure this can be called a memory leak.
The first one was with Octave when I solved a big set of huge ODE's. The memory got slowly filled up until it reached its limit and everything got really slow.
The second one was a C++ program writing a lot of stuff to std output. It ran a while and the memory was filling up. htop said that tmux was consuming the biggest part of my buffer. I had to restart the system to free the memory, closing tmux didn't help.
Is this normal behaviour or is there a missing mechanism to prevent such things?
Cheers
Reza
Offline
You mean, "out of memory".
Offline
yes, sorry of course an out of memory problem
Offline
Valgrind can help you find memory bugs in your code. It's up to you to fix them though. If you think you've found a problem in somebody else's program, file a bug report and help to squash it.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
You need to start thinking like a computer user from the 1970s. Sure, for every day tasks, RAM can be thought of as being overabundant. But if you are doing any sort of complex computations, you need to immediately consider your RAM usage. They were solving complex math with computers in the 70s but they had to be extremely aware of their resource usage and had to effectively divide and conquer to solve the problems.
Is there a way you can optimize solving your ODEs? Rather than just handing them off to Octave, you may have to manually do a lot of the solving (calculating the Jacobians, etc), storing things to disk and reading them as necessary, etc. Don't assume that you can just store everything in memory. Treat RAM as a convenient place to rapidly do a few computations while the rest of your data sits in relatively cheaper disk space.
As for your tmux problem, there's almost certainly a setting for it in which you can limit the scrollback buffer size. Alternatively, redirect the output to a file, assuming you have sufficient disk space.
Offline
@jakobcreutzfeldt
Thanks for your tips! But I was wondering about a system wide approach. Musn't there be something take control over the processes before the system gets untradeable?
Offline
That would be the OOM killer.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
And the OOM killer is much more proactive if you disable swap. This is one of the main reasons I don't generally use swap. I can always activate it if I know I'll need it, but under normal conditions I know I never get anywhere near using all my ram - so if the ram is full something has gone very wrong. Rather that grinding to a slow crawl for tens of minutes or more as swap also fills up and gets swapped in and out of ram repeatedly, the OOM killer will go into action as soon as the ram is full.
However, disabling swap for this purpose assumes that something has actually gone wrong to use all the ram. If you are doing calculations that really will need all the ram, then the only approach is to simplify the process as jakobcreutzfeldt suggests.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
How then my OOM killer didn't react and killed the memory consuming processes? Do I have to enable it somewhere?
Offline
You haven't given us any information with which to answer that question. Is your memory actually *full*? Do you have swap enabled? If so the answer is in my last post.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
When I use
free -mI get
total used free shared buffers cached
Mem: 7869 2917 4951 149 132 729
-/+ buffers/cache: 2055 5813
Swap: 0 0 0So I'm not using swap at all but the OOM killer didn't react proactive at all (I had to force shutdown by pressing the power off button).
Last edited by rezahousseini (2013-12-19 13:07:58)
Offline
Please use code tags when pasting to the boards; it makes the output readable
https://wiki.archlinux.org/index.php/Fo … s_and_Code
Offline
When I use free -m I get
<snip>
So I'm not using swap at all but the OOM killer didn't react proactive at all (I had to force shutdown by pressing the power off button).
Please, please use code tags for any terminal output or code snippets. Trying to read something that was originally formatted for a monospaced environment in anything but verbatim is awful.
Edit: beaten by jwr (it wasn't the first time; nor—I believe—shall it be the last)
All the best,
-HG
Last edited by HalosGhost (2013-12-19 07:17:56)
Offline
Your not even remotely close to being out of memory - so the out-of-memory killer will of course not do anything.
I think you need to go back to the start and provide us with information about what is actually happening, not about your assumptions. It seems the only symptom you've described is that the system slows or is unresponsive, is this correct? You've had various contributors in this thread now chasing their tails for 13 posts because you started out with the claim that you were out of memory (and a title that is even more inaccurate).
Please describe the actual syptoms, and provide real diagnostic information. For a start (but only a start) run htop when you think this will happen, and see if anything stands out.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline