On Thursday, 7 July 2016, Tim Wescott wrote:
>  I have a program (Scilab), which occasionally decides that it's hungry
>  and wants to eat lots and lots of memory.  This seems to be dependent
>  on what code I'm running (Scilab includes an interpreted data-analysis
>  language).
>
>  Something about the way that Ubuntu is set up lets it use up so much
>  memory that it bogs down my computer to the point where I need to do a
>  hard reboot. I think that it's hitting swap so hard that the normal
>  rationing of processor time to processes is hijacked by memory
>  availability.
>
>  Once I'm done rattling the appropriate bars at Scilab.org with a bug
>  report, is there a way to launch a program under Linux that limits its
>  memory access, either by total amount or in a way that'll throttle down
>  just that program when it goes to swap?

Sure, check out ulimit.  There are multiple limits Linux/UNIX imposes on 
every process, like open files and memory size.  I've used ulimit in the 
past for that sort of thing, myself.  And those are just the old controls; 
I think a new system limit system exists, now, too, although the name 
escapes me.  Someone here may recognize what I'm talking about or I may be 
confused.  There may also be wrapper programs for that, like 'throttle' 
but for memory.  Ah, cgroups!  Larry got it.  I think ulimit is much 
easier to use quickly for debugging and user stuff, but cgroups obviously 
for long term situations or daemons.

But, I would think scilab should have configurables for that too. 
Something like that sounds vaguely familiar from reading numpy 
documentation.  Hmm, maybe I'm just thinking of python itself; check 
there.  Python would be best way to handle that, I would think.

You can play with swap parameters, too.  If you think it's swap, though, 
you might turn off swap altogether and see what happens under those 
conditions.  If it slows down without swap, it's not just swapping that is 
causing the slowdown.

-- 
Paul
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to