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
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]