vm = VirtualMachine.attach(String.valueOf(pid)); HotSpotVirtualMachine hvm = (HotSpotVirtualMachine) vm; try (InputStream in = hvm.executeJCmd("GC.run");) { byte b[] = new byte[256]; int n;
@Override public void loadAgentLibrary(String agentLibrary, String options) throws AgentLoadException, AgentInitializationException, IOException { loadAgentLibrary(agentLibrary, false, options); }
@Override public void close() throws IOException { SolarisVirtualMachine.close(s); } }
@Override public synchronized int read() throws IOException { byte[] b = new byte[1]; int n = read(b, 0, 1); if (n == 1) { return b[0] & 0xff; } else { return -1; } }
@Override public synchronized int read() throws IOException { byte b[] = new byte[1]; int n = this.read(b, 0, 1); if (n == 1) { return b[0] & 0xff; } else { return -1; } }
@Override public void close() throws IOException { LinuxVirtualMachine.close(s); } }
@Override public void detach() throws IOException { synchronized (this) { if (hProcess != -1) { closeProcess(hProcess); hProcess = -1; } } }
@Override public void close() throws IOException { if (hPipe != -1) { WindowsVirtualMachine.closePipe(hPipe); hPipe = -1; } } }
@Override public synchronized int read() throws IOException { byte b[] = new byte[1]; int n = this.read(b, 0, 1); if (n == 1) { return b[0] & 0xff; } else { return -1; } }
@Override public synchronized int read() throws IOException { byte b[] = new byte[1]; int n = this.read(b, 0, 1); if (n == 1) { return b[0] & 0xff; } else { return -1; } }
@Override public void close() throws IOException { BsdVirtualMachine.close(s); } }
/** * Load agent library - library name will be expanded in target VM. */ @Override public void loadAgentLibrary(String agentLibrary, String options) throws AgentLoadException, AgentInitializationException, IOException { loadAgentLibrary(agentLibrary, false, options); }
@Override public synchronized int read() throws IOException { byte b[] = new byte[1]; int n = this.read(b, 0, 1); if (n == 1) { return b[0] & 0xff; } else { return -1; } }
@Override public synchronized int read() throws IOException { byte[] b = new byte[1]; int n = read(b, 0, 1); if (n == 1) { return b[0] & 0xff; } else { return -1; } }
@Override public void close() throws IOException { LinuxVirtualMachine.close(s); } }
@Override public void detach() throws IOException { synchronized (this) { if (hProcess != -1) { closeProcess(hProcess); hProcess = -1; } } }
@Override public void close() throws IOException { if (hPipe != -1) { closePipe(hPipe); hPipe = -1; } } }
/** * Detach from the target VM */ @Override public void detach() throws IOException { synchronized (this) { if (fd != -1) { close(fd); fd = -1; } } }
@Override public void loadAgentPath(String agentLibrary, String options) throws AgentLoadException, AgentInitializationException, IOException { loadAgentLibrary(agentLibrary, true, options); }
/** * Load agent - absolute path of library provided to target VM. */ @Override public void loadAgentPath(String agentLibrary, String options) throws AgentLoadException, AgentInitializationException, IOException { loadAgentLibrary(agentLibrary, true, options); }