public final class MemoryUtils extends Object
| Constructor and Description |
|---|
MemoryUtils() |
| Modifier and Type | Method and Description |
|---|---|
static List<String> |
buildJavaArg() |
static int |
getPid()
Returns the pid of the current process.
|
static String |
memoryUsage()
Calculates the memory usage according to Runtime.
|
static String |
pidMemoryUsage()
Calculates the memory usage according to ps for this process.
|
static String |
pidMemoryUsage(int pid)
Calculates the memory usage according to ps for a given pid.
|
public static String memoryUsage()
public static String pidMemoryUsage() throws IOException, InvocationTargetException, NoSuchMethodException, IllegalAccessException, NoSuchFieldException
IOExceptionInvocationTargetExceptionNoSuchMethodExceptionIllegalAccessExceptionNoSuchFieldExceptionpublic static int getPid()
throws NoSuchFieldException,
IllegalAccessException,
NoSuchMethodException,
InvocationTargetException
NoSuchFieldExceptionIllegalAccessExceptionNoSuchMethodExceptionInvocationTargetExceptionpublic static String pidMemoryUsage(int pid) throws IOException
pid - the pid of the processIOExceptionCopyright © 2015. All rights reserved.