B
B
Bogdan Markov2016-02-08 16:03:58
linux
Bogdan Markov, 2016-02-08 16:03:58

How to limit app memory consumption on Ubuntu?

While learning to program (C++ in Qt Creator) on my machine (Ubuntu 14.04 desktop), I sometimes encounter that my program eats too much memory due to my development errors (for example, the program gets into an infinite loop, where it constantly allocates memory for heap).
In such cases, the whole system starts to terribly slow down and the only way I see is to turn it off with the power button and then start it all over again, since during this terrible slowdown it is impossible to close the memory-consuming program or do anything else.
So I wonder if there is a way to make it so that when a certain limit is exceeded, the system stops allocating memory to the application? It would be much more convenient than shutting down the entire system.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Ergil Osin, 2016-02-08
@Puchryamba

man cgroups

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question