|
From: GMX <lg...@gm...> - 2002-10-09 02:51:49
|
Hi, I would like to ask if it is possible to add some more functionality to the wrapper code. First, the ability to detect certain exceptions and as a result restart the machine. Mainly I am thinking about a OutOfMemoryException, which can occur if a system runs for a long time and somehow the code does not clear out its resources. Or a slight memory leak, which of course should be fixed in the first place but with that extra functionality in the wrapper it would mean to have another countermeasure against dreadful bugs. Second, and this is along the same line, monitoring the memory usage. Say you have set the maximum memory to 128Mb, it would then be good to set some sort of threshold to monitor the garbage collection and its effectiveness. In other words, when the memory increases above a certain limit and then stays there for a given amount of time, then restart the app. This is for the same reasons as above. Usually the garbage collector thread should free enough resources ones they are filled up, but when buggy code keeps eating resources, the garbage collector can only free a small percentage each time, even when running full garbage collections. As an example the minimum used memory limit that triggers this watchdog could be set to 112Mb and the time limit to 15 mins. If the memory usage does not drop below 112Mb within 15 mins from the time it got over that memory usage level, then restart the app. What I do not know without diving head on into the code is of this sort of thing is possible with the way wrapper is working and if that information can be reliably gathered using C or Java code. I hope I explained this thoroughly enough. Any help/hint/idea is highly appreciated. Keep up the good work! Kind regards, Lars |