io.netty.util.internal.OutOfDirectMemoryError Java Examples
The following examples show how to use
io.netty.util.internal.OutOfDirectMemoryError.
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: FailureUtils.java From Bats with Apache License 2.0 | 5 votes |
public static boolean isDirectMemoryOOM(Throwable e) { if (e instanceof OutOfDirectMemoryError || e instanceof OutOfMemoryException) { // These are always direct memory errors return true; } return (e instanceof OutOfMemoryError) && DIRECT_MEMORY_OOM_MESSAGE.equals(e.getMessage()); }
Example #2
Source File: NettyToStyxResponsePropagatorTest.java From styx with Apache License 2.0 | 5 votes |
private OutOfDirectMemoryError newOutOfDirectMemoryError(String message) throws IllegalAccessException, InvocationTargetException, InstantiationException { // OutOfDirectMemoryError has a package-private constructor. // Use reflection to instantiate it for testing purposes. Constructor<OutOfDirectMemoryError> constructor = null; try { constructor = OutOfDirectMemoryError.class.getDeclaredConstructor(String.class); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } constructor.setAccessible(true); return constructor.newInstance(message); }