@ RequirePOST public void doSimulateOutOfMemory ( ) throws IOException { checkPermission ( ADMINISTER ) ; System . out . println ( "Creating artificial OutOfMemoryError situation" ) ; List < Object > args = new ArrayList <> ( ) ; //noinspection InfiniteLoopStatement while ( true ) args . add ( new byte [ 1024 * 1024 ] ) ; }
Simulates OutOfMemoryError . Useful to make sure OutOfMemoryHeapDump setting .