alebu
Programmer
- Sep 7, 2002
- 46
Hi all, is it possible to limit somehow allowed memory for some code block (method for example)? For example, I am going to run some code but it is possible that it can try to use too much memory (heap or stack). The practical usage of such limitation can be: preventing some plugin to suck all possible for JVM memory or stack memory and this way preventing the situation where custom code on oput of memory will kill a whole application. I mean, I am interested in something like (just free typing now):
//set limitation for heap and stack memory
try{
// run some code with applied limitations
}catch( some_special_exception ex){
// well, do something...
}
As I know it is not possible for now but maybe there are some strategies which may help at least somehow.
//set limitation for heap and stack memory
try{
// run some code with applied limitations
}catch( some_special_exception ex){
// well, do something...
}
As I know it is not possible for now but maybe there are some strategies which may help at least somehow.