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
IOException
InvocationTargetException
NoSuchMethodException
IllegalAccessException
NoSuchFieldException
public static int getPid() throws NoSuchFieldException, IllegalAccessException, NoSuchMethodException, InvocationTargetException
NoSuchFieldException
IllegalAccessException
NoSuchMethodException
InvocationTargetException
public static String pidMemoryUsage(int pid) throws IOException
pid
- the pid of the processIOException
Copyright © 2015. All rights reserved.