
这也不例外。这是一个错误:java.lang.OutOfMemoryError
当它从Throwable下降时,你可以捕获它:
try { // create lots of objects here and stash them somewhere} catch (OutOfMemoryError E) { // release some (all) of the above objects}但是,除非你要进行一些相当具体的工作(例如,在特定代码段内分配大量工作),否则你可能将无法捕捉到它,因为你将不知道它将从何处抛出。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)