src/org/jnetpcap/nio/JMemory.java
public static long maxDirectMemory() {
		if (directMemory != 0) {
			return directMemory;
		}

		Properties p = System.getProperties();
		String s = p.getProperty("org.jnetsoft.nio.MaxDirectMemorySize");
		s = (s == null) ? p.getProperty("nio.MaxDirectMemorySize") : s;
		s = (s == null) ? p.getProperty("org.jnetsoft.nio.mx") : s;
		s = (s == null) ? p.getProperty("nio.mx") : s;

		if (s != null) {
			directMemory = parseSize(s); // process suffixes kb,mb,gb,tb
		}

		if (directMemory == 0) {
			directMemory = maxDirectoryMemoryDefault();
		}

		return directMemory;
	}
/**
	 * Returns the hard limit for the amount of memory native is allowed to
	 * allocate. The memory setting defaults to JVMs max memory which can be
	 * specified with JVM command line option '-Xmx&lt;size&gt;.Once the 'nio.mx'
	 * limit is reached, the allocating thread is blocked and a JVM GC request is
	 * issued. The allocating thread continues to wait, until sufficient minimum
	 * amount (Default: {@literal DisposableGC#MIN_MEMORY_RELEASE})of native
	 * memory was cleaned up or a timeout (Default:
	 * 
	 * @return the limit in number of bytes
	 *         {@literal DisposableGC#OUT_OF_MEMORY_TIMEOUT} ms) occurs.
	 *         <p>
	 *         This limit can be set at startup of the application using the
	 *         following system properties, which are checked in the order listed
	 *         below:
	 *         <ol>
	 *         <li><code>org.jnetsoft.nio.MaxDirectMemorySize</code>
	 *         <li><code>nio.MaxDirectMemorySize</code>
	 *         <li><code>org.jnetsoft.nio.mx</code>
	 *         <li><code>nio.mx</code>
	 *         </ol>
	 *         The different property names, from the most fully qualified to the
	 *         least, are provided to property name conflict resolution. For
	 *         convenience, it is recommended that the user choose the least
	 *         qualified property name to use. In the unlikely event that another
	 *         library within the same runtime application uses the same property
	 *         name, one of the more qualified (or longer) property names can be
	 *         used to resolve the conflict.
	 *         </p>
	 */
Returns the hard limit for the amount of memory native is allowed to
allocate. The memory setting defaults to JVMs max memory which can be
specified with JVM command line option '-Xmx<size>.Once the 'nio.mx'
limit is reached, the allocating thread is blocked and a JVM GC request is
issued. The allocating thread continues to wait, until sufficient minimum
amount (Default:  DisposableGC#MIN_MEMORY_RELEASE)of native
memory was cleaned up or a timeout (Default.

@return the limit in number of bytes
DisposableGC#OUT_OF_MEMORY_TIMEOUT ms) occurs.

This limit can be set at startup of the application using the
following system properties, which are checked in the order listed
below:

org.jnetsoft.nio.MaxDirectMemorySize
nio.MaxDirectMemorySize
org.jnetsoft.nio.mx
nio.mx

The different property names, from the most fully qualified to the
least, are provided to property name conflict resolution. For
convenience, it is recommended that the user choose the least
qualified property name to use. In the unlikely event that another
library within the same runtime application uses the same property
name, one of the more qualified (or longer) property names can be
used to resolve the conflict.
Returns the hard limit for the amount of memory native is allowed to allocate . The memory setting defaults to JVMs max memory which can be specified with JVM command line option ' - Xmx<size > . Once the ' nio . mx ' limit is reached the allocating thread is blocked and a JVM GC request is issued . The allocating thread continues to wait until sufficient minimum amount ( Default : DisposableGC#MIN_MEMORY_RELEASE ) of native memory was cleaned up or a timeout ( Default . @return the limit in number of bytes DisposableGC#OUT_OF_MEMORY_TIMEOUT ms ) occurs . This limit can be set at startup of the application using the following system properties which are checked in the order listed below : org . jnetsoft . nio . MaxDirectMemorySize nio . MaxDirectMemorySize org . jnetsoft . nio . mx nio . mx The different property names from the most fully qualified to the least are provided to property name conflict resolution . For convenience it is recommended that the user choose the least qualified property name to use . In the unlikely event that another library within the same runtime application uses the same property name one of the more qualified ( or longer ) property names can be used to resolve the conflict .
public static long maxDirectMemory() {
		if (directMemory != 0) {
			return directMemory;
		}
		Properties p = System.getProperties();
		String s = p.getProperty("org.jnetsoft.nio.MaxDirectMemorySize");
		s = (s == null) ? p.getProperty("nio.MaxDirectMemorySize") : s;
		s = (s == null) ? p.getProperty("org.jnetsoft.nio.mx") : s;
		s = (s == null) ? p.getProperty("nio.mx") : s;
		if (s != null) {
			directMemory = parseSize(s); 
		}
		if (directMemory == 0) {
			directMemory = maxDirectoryMemoryDefault();
		}
		return directMemory;
	}
public static long maxDirectMemory ( ) { if ( directMemory != 0 ) { return directMemory ; } Properties p = System . getProperties ( ) ; String s = p . getProperty ( "org.jnetsoft.nio.MaxDirectMemorySize" ) ; s = ( s == null ) ? p . getProperty ( "nio.MaxDirectMemorySize" ) : s ; s = ( s == null ) ? p . getProperty ( "org.jnetsoft.nio.mx" ) : s ; s = ( s == null ) ? p . getProperty ( "nio.mx" ) : s ; if ( s != null ) { directMemory = parseSize ( s ) ; } if ( directMemory == 0 ) { directMemory = maxDirectoryMemoryDefault ( ) ; } return directMemory ; }
Returns the hard limit for the amount of memory native is allowed to
 allocate.
Returns the hard limit for the amount of memory native is allowed to allocate .
// process suffixes kb,mb,gb,tb