LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-29-2019, 04:11 AM   #1
postcd
Member
 
Registered: Oct 2013
Posts: 452

Rep: Reputation: Disabled
How can i limit .py process RAM and SWAP usage?


What is the way to limit it and at same time prevent it to be overusing my HDD swap iops? Note i do not know python language. and i do not want to terminate or restart the process if it reach mine defined RAM usage threshold. The script developer was already notified the script is abusing RAM, but it is complicated system and developer is not likely to fix it soon.

This is Linux Debian 8 with systemd
 
Old 01-29-2019, 05:40 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 17,620

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
Probably not.
If the codde is that badly written and the dev is incapable of fixing it, limiting it will likely cause the OOM to kill it.

What's the business case ?. If the code has to run, bad luck - live with it.
 
1 members found this post helpful.
Old 01-29-2019, 07:14 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 21,143

Rep: Reputation: 5360Reputation: 5360Reputation: 5360Reputation: 5360Reputation: 5360Reputation: 5360Reputation: 5360Reputation: 5360Reputation: 5360Reputation: 5360Reputation: 5360
Quote:
Originally Posted by postcd View Post
What is the way to limit it and at same time prevent it to be overusing my HDD swap iops? Note i do not know python language. and i do not want to terminate or restart the process if it reach mine defined RAM usage threshold. The script developer was already notified the script is abusing RAM, but it is complicated system and developer is not likely to fix it soon. This is Linux Debian 8 with systemd
Again, you *STILL* need to read the "Question Guidelines" and "How to ask a smart question" links. Because it again appears as if you've done no research of your own before posting, since putting "linux limit amount of memory a program uses", returns a LOT of suggestions. Some using other programs...some using built-in Linux utilities. Much like the ones suggested to you TWO YEARS AGO:
https://www.linuxquestions.org/quest...nt-4175601812/

...because ulimit is one of the options. There is also the "time" command, look into cgroups, or do any one of a number of different things. Again, a small amount of effort would have told you these things. And what you're asking for is impossible, unless you modify the python code. Because anything you use to do this will, by its nature, either swap it out or kill it...both of which you supposedly can't do on this 'complicated system'.

Not sure why you can't simply look at the Python code and make the changes yourself; python is fairly easy to understand. And if you told us what this program is, we may even be able to help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
stack limit of Process and stack limit of thread particlereddy Linux - Kernel 7 11-21-2015 01:51 PM
Max ram usage stuck at 1.3gig limit, uses swap instead? firebirdsql Linux - Newbie 7 07-18-2012 07:10 AM
Why size of swap space is 2x of RAM??? Why not 1.5x of RAM or 2.5x of RAM??? Saurav Ghosh Linux - Newbie 7 11-01-2011 03:49 AM
Lucid with 1GB RAM hangs/reboots frequently and Swap usage is very low rusty_vin Linux - Newbie 9 01-01-2011 12:28 PM
ram and swap usage? FredericV Linux - General 6 03-25-2007 04:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration