Java Code Examples for com.sun.jdi.ArrayReference#isCollected()
The following examples show how to use
com.sun.jdi.ArrayReference#isCollected() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OomDebugTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("unused") // called via reflection private void test2() throws Exception { System.out.println("DEBUG: ------------> Running test2"); try { Field field = targetClass.fieldByName("byteArray"); ArrayType arrType = (ArrayType)field.type(); for (int i = 0; i < 15; i++) { ArrayReference byteArrayVal = arrType.newInstance(3000000); if (byteArrayVal.isCollected()) { System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); continue; } invoke("testPrimitive", "([B)V", byteArrayVal); } } catch (VMOutOfMemoryException e) { defaultHandleOOMFailure(e); } }
Example 2
Source File: OomDebugTest.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("unused") // called via reflection private void test2() throws Exception { System.out.println("DEBUG: ------------> Running test2"); try { Field field = targetClass.fieldByName("byteArray"); ArrayType arrType = (ArrayType)field.type(); for (int i = 0; i < 15; i++) { ArrayReference byteArrayVal = arrType.newInstance(3000000); if (byteArrayVal.isCollected()) { System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); continue; } invoke("testPrimitive", "([B)V", byteArrayVal); } } catch (VMOutOfMemoryException e) { defaultHandleOOMFailure(e); } }
Example 3
Source File: OomDebugTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("unused") // called via reflection private void test2() throws Exception { System.out.println("DEBUG: ------------> Running test2"); try { Field field = targetClass.fieldByName("byteArray"); ArrayType arrType = (ArrayType)field.type(); for (int i = 0; i < 15; i++) { ArrayReference byteArrayVal = arrType.newInstance(3000000); if (byteArrayVal.isCollected()) { System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); continue; } invoke("testPrimitive", "([B)V", byteArrayVal); } } catch (VMOutOfMemoryException e) { defaultHandleOOMFailure(e); } }
Example 4
Source File: OomDebugTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("unused") // called via reflection private void test2() throws Exception { System.out.println("DEBUG: ------------> Running test2"); try { Field field = targetClass.fieldByName("byteArray"); ArrayType arrType = (ArrayType)field.type(); for (int i = 0; i < 15; i++) { ArrayReference byteArrayVal = arrType.newInstance(3000000); if (byteArrayVal.isCollected()) { System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); continue; } invoke("testPrimitive", "([B)V", byteArrayVal); } } catch (VMOutOfMemoryException e) { defaultHandleOOMFailure(e); } }
Example 5
Source File: OomDebugTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("unused") // called via reflection private void test2() throws Exception { System.out.println("DEBUG: ------------> Running test2"); try { Field field = targetClass.fieldByName("byteArray"); ArrayType arrType = (ArrayType)field.type(); for (int i = 0; i < 15; i++) { ArrayReference byteArrayVal = arrType.newInstance(3000000); if (byteArrayVal.isCollected()) { System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); continue; } invoke("testPrimitive", "([B)V", byteArrayVal); } } catch (VMOutOfMemoryException e) { defaultHandleOOMFailure(e); } }
Example 6
Source File: OomDebugTest.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("unused") // called via reflection private void test2() throws Exception { System.out.println("DEBUG: ------------> Running test2"); try { Field field = targetClass.fieldByName("byteArray"); ArrayType arrType = (ArrayType)field.type(); for (int i = 0; i < 15; i++) { ArrayReference byteArrayVal = arrType.newInstance(3000000); if (byteArrayVal.isCollected()) { System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); continue; } invoke("testPrimitive", "([B)V", byteArrayVal); } } catch (VMOutOfMemoryException e) { defaultHandleOOMFailure(e); } }
Example 7
Source File: OomDebugTest.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
@SuppressWarnings("unused") // called via reflection private void test2() throws Exception { System.out.println("DEBUG: ------------> Running test2"); try { Field field = targetClass.fieldByName("byteArray"); ArrayType arrType = (ArrayType)field.type(); for (int i = 0; i < 15; i++) { ArrayReference byteArrayVal = arrType.newInstance(3000000); if (byteArrayVal.isCollected()) { System.out.println("DEBUG: Object got GC'ed before we can use it. NO-OP."); continue; } invoke("testPrimitive", "([B)V", byteArrayVal); } } catch (VMOutOfMemoryException e) { defaultHandleOOMFailure(e); } }