void () { Runnable runnable = () -> ApplicationManager.getApplication().runReadAction(() -> { try { getTreeTextByFile(getTestName(false) + ".html"); } catch (Exception ex) { throw new RuntimeException(ex); } }); for(int i = 0; i < 300; ++i) { final Runnable runnable1 = runnable; runnable = () -> ApplicationManager.getApplication().runReadAction(() -> { @SuppressWarnings("UnusedDeclaration") int a = 1; final Runnable run = runnable1; // ensure stack allocated for frame run.run(); }); } runnable.run(); }