Killing a process going over memory usage

Posts 1–4 of 4 · Page 1 of 1
Killing a process going over memory usage
Hey ,

I have a minecraft server and we have been making an auto-restarter when it crashes

So basically if java.exe goes over 300,000MB of memory usage then it will kill the process

Also if someone could help if it is possible to read a Read time out error through a visual basic program off a console

Thanks!
Vern
Why would u want to kill it?
Type "stop" in the command box and restart?

@VernK
No, when you have a read time out in a minecraft server You can't do anything
Wait what? 300GB of RAM? Are you sure? I think you mean 300,000KB.

[highlight=vb.net]'Put this in a timer or something
Dim pJavaArray() As Process = Process.GetProcessesByName("java")
If pJavaArray.Length > 0 AndAlso pJavaArray(0).WorkingSet64 >= (300 * 1024 * 1024) Then
pJavaArray(0).Kill()
'Add code here to restart the server
End If[/highlight]
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us