Questions tagged [kill]

Kill is an operation of removing an object or process from memory so that other processes/variables can use them.

1603 questions
37
votes
5 answers

How do I kill an Activity when the Back button is pressed?

I got an Activity that when it starts, it loads an image from the internet. In an effort to save memory, when the Activity is left by the back button being pressed, I want the activity to dump all data, that is get rid of all the strings and images…
Shaun
  • 5,483
  • 10
  • 40
  • 49
34
votes
8 answers

Emacs: How to yank the last yanked text regardless of subsequent kills?

I often find myself repeatedly yanking something after doing some kills and it becomes a process like: C-y C-y M-y C-y M-y M-y C-y M-y M-y M-y Each time I kill some text it pushes the first kill back in the kill ring so that I need to cycle…
Reed G. Law
  • 3,897
  • 1
  • 41
  • 78
34
votes
2 answers

What happens if you kill a long-running alter query?

What happens if you kill a long-running alter query? Will the alter query simply revert? How long could that take (as a proportion of the time it has already been running)? What if that query is being replicated onto another server? Will killing the…
B T
  • 57,525
  • 34
  • 189
  • 207
33
votes
3 answers

"Gracefully" killing a process

Right now I am using Process.Kill() to kill a process. Is there a way though, instead of just killing it immediately, that I can like send a message to the process instructing it to close so that it can gracefully clean up and shut down. Basically,…
Icemanind
  • 47,519
  • 50
  • 171
  • 296
31
votes
7 answers

How to kill a process in cygwin?

Hi i have the following process which i cant kill: I am running cygwin in windows xp 32 bit. I have tried issuing the following commands: /bin/kill -f 4760 /bin/kill -9 5000 kill -9 5000 kill 5000 When i write /bin/kill -f 4760 i get the message,…
Diemauerdk
  • 5,238
  • 9
  • 40
  • 56
30
votes
7 answers

How to cleanly shutdown Eclipse from Linux command line?

Is there a way to shutdown Eclipse cleanly from the command line, such that files and workspaces are saved? kill -3 doesn't do anything. kill -1 and kill -15 (default) causes Eclipse to exit abruptly with JVM termination popup. kill -9 does the same…
Maian
  • 528
  • 2
  • 5
  • 11
30
votes
10 answers

How can I kill all sessions connecting to my oracle database?

I need to quickly (and forcibly) kill off all external sessions connecting to my oracle database without the supervision of and administrator. I don't want to just lock the database and let the users quit gracefully. How would I script this?
BIBD
  • 15,107
  • 25
  • 85
  • 137
30
votes
5 answers

Prevent Activity Stack from being Restored?

When an application's process is killed, its activity stack is saved. Then when the application is restarted, all my activities resume and run into null pointers. Rather than modify every activity to accommodate this event, I would rather just have…
Nathan Fig
  • 14,970
  • 9
  • 43
  • 57
30
votes
3 answers

How to stop service from its own foreground notification

I have a Service running. and in its onStartCommand I am doing startforeground to avoid killing by system. public int onStartCommand(Intent intent, int flags, int startId) { if (ACTION_STOP_SERVICE.equals(intent.getAction())) { …
SimpleCoder
  • 1,665
  • 1
  • 21
  • 34
28
votes
5 answers

Run a process and kill it if it doesn't end within one hour

I need to do the following in Python. I want to spawn a process (subprocess module?), and: if the process ends normally, to continue exactly from the moment it terminates; if, otherwise, the process "gets stuck" and doesn't terminate within (say)…
Federico A. Ramponi
  • 46,145
  • 29
  • 109
  • 133
27
votes
2 answers

How to get variable from text file into Bash variable

Simple question, in BASH I'm trying to read in a .pid file to kill a process. How do I read that file into a variable. All the examples I have found are trying to read in many lines. I only want to read the one file that just contains the…
AndyW
  • 275
  • 1
  • 4
  • 8
24
votes
1 answer

How to kill a range of consecutive processes in Linux?

I am working on a multi-user Ubuntu server and need to run multiprocessing python scripts. Sometimes I need to kill some of those processes. For example, $ ps -eo pid,comm,cmd,start,etime | grep .py 3457 python python process_to_kill.py -…
Xiaofeng Fan
  • 437
  • 1
  • 4
  • 9
24
votes
5 answers

How to kill a running process using ansible?

I have an ansible playbook to kill running processes and works great most of the time!, however, from time to time we find processes that just can't be killed so, "wait_for" gets to the timeout, throws an error and it stops the process. The current…
Julio Fernandez
  • 255
  • 1
  • 2
  • 5
24
votes
6 answers

Process.Kill() doesn't seem to kill the process

I am having trouble using Process.Kill(). I think I must be misunderstanding how it works. This is my test function. I start a long-running process (ping -t) and then kill it five seconds later. I can see the ping process show up, but the process is…
Kris Harper
  • 5,672
  • 8
  • 51
  • 96
24
votes
6 answers

Process.Kill() Access Denied

When I run the following code, a Win32Exception is thrown for Access Denied. I cannot find any solutions via search. How do I fix this? foreach (ListViewItem list in showprocesses.SelectedItems) { Process p =…
Ezzy
  • 1,423
  • 2
  • 15
  • 32