LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-14-2008, 07:28 AM   #1
vvopenka
LQ Newbie
 
Registered: Sep 2006
Location: Prague
Distribution: Ubuntu 10.04
Posts: 18

Rep: Reputation: 1
Preventing a process to freez my computer


Hi, I have a little problem and I cannot find an answer anywhere.
I'm developing my own application in C++ which does lots of calculations and uses FreeGLUT and GTK+. Sometimes I make an error and it gets into a neverending loop. This freezes my entire operating system. Btw. I'm using FC 5 and GNOME. I cannot kill the process, I cannot use mouse or keyboard, so I cannot run another terminal to kill it. It just gets stuck, or extremely slow.
Now, what I need. When starting this process in a terminal, I would need to tell my operating system, that this process is "bad" How can I run this process so that it cannot eat up all computing time of my operating system? Or maybe is there a demon, or something like that, which would kill it after some time? It's so stupid to restart my computer everytime this happens. I usually need two or three runs before I find the mistake.

Thanks for help.
Vasek
 
Old 11-14-2008, 08:25 AM   #2
vladmihaisima
Member
 
Registered: Oct 2002
Location: Delft, Netherlands
Distribution: Gentoo
Posts: 196

Rep: Reputation: 33
Here are some ideas:

- go to a text only console (press control-alt-f1, to return to X press control-alt-f7) and kill the process from there ? Sometimes, even if X is blocked the text console will work.

- ssh into your machine (if you have another machine close). I have seen machines completly blocked in which you could ssh and kill the ofending process

- if you use bash, "man bash" and search for ulimit (press '/' and the the string you want to search. ulimit can limit the resources the shell and it's children will use.

- use nice ("man nice" for more info)

Hope at least one idea works for you
 
Old 11-14-2008, 10:29 AM   #3
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
run it at a high nice level, that'll prevent it from hogging all your resources and effectively freezing your computer

nice -n 19 program
 
Old 11-18-2008, 06:51 AM   #4
vvopenka
LQ Newbie
 
Registered: Sep 2006
Location: Prague
Distribution: Ubuntu 10.04
Posts: 18

Original Poster
Rep: Reputation: 1
Thank you all. nice was exactly what I was looking for. Now it does what it should and my OS already allows me to kill the process.
 
  


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
LXer: Evaluating What Users Do on the Computer with Process Accounting LXer Syndicated Linux News 0 12-10-2006 07:54 PM
bootup freez kingM Mandriva 4 10-18-2004 02:28 PM
How can I tell what process froze my computer? LX-i Linux - Newbie 4 06-26-2004 10:57 PM
How does mail get to my computer? What is the process? BrianK Linux - General 3 04-12-2004 03:22 PM
preventing multiple process instances the_dayi Programming 2 07-14-2003 06:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:48 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