/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import javax.accessibility.*;
import javax.management.*;
@SuppressWarnings("serial")
/*
Hierarchy of panels and layouts for this tab:
MemoryTab (BorderLayout)
North: topPanel (BorderLayout)
Center: controlPanel (FlowLayout)
plotterChoice, timeComboBox
East: topRightPanel (FlowLayout)
gcButton
Center: plotterPanel
Center: plotter
South: bottomPanel (BorderLayout)
Center: details
East: poolChart
*/
}
super(vmPanel, getTabName());
// Plotter choice
plotterChoice.addItemListener(this);
// Range control
timeComboBox = new TimeComboBox();
timeComboBox));
gcButton.addActionListener(this);
}
return Messages.HEAP_MEMORY_USAGE;
}
};
return Messages.NON_HEAP_MEMORY_USAGE;
}
};
// Now add memory pools
// Heap or non-heap?
boolean isHeap = false;
new String[] { "Type" });
}
if (isHeap) {
} else {
// Will be added to plotterList below
}
}
}
// Add non-heap plotters last
}
}
}
}
public void gc() {
new Thread("MemoryPanel.gc") {
public void run() {
try {
} catch (UndeclaredThrowableException e) {
} catch (IOException e) {
// Ignore
}
}
}.start();
}
private long timeStamp;
private String detailsStr;
private boolean initialRun = false;
public Boolean doInBackground() {
if (plotterList == null) {
try {
} catch (UndeclaredThrowableException e) {
return false;
} catch (final IOException ex) {
return false;
}
initialRun = true;
}
int n = plotterList.size();
used = new long[n];
committed = new long[n];
max = new long[n];
threshold = new long[n];
for (int i = 0; i < n; i++) {
used[i] = -1L;
threshold[i] = -1L;
try {
if (plotter instanceof PoolPlotter) {
}
}
} else if (plotter == heapPlotter) {
} else if (plotter == nonHeapPlotter) {
}
} catch (UndeclaredThrowableException e) {
return false;
} catch (IOException ex) {
// Skip this plotter
}
}
}
detailsStr = formatDetails();
return true;
}
protected void done() {
try {
if (!get()) {
return;
}
} catch (InterruptedException ex) {
return;
} catch (ExecutionException ex) {
}
return;
}
if (initialRun) {
// Add Memory Pools
for (Plotter p : plotterList) {
plotterChoice.addItem(p);
}
}
int n = plotterList.size();
int poolCount = 0;
for (int i = 0; i < n; i++) {
if (used[i] >= 0L) {
if (plotter instanceof PoolPlotter) {
if (threshold[i] > 0L) {
}
} else {
}
}
}
}
}
};
}
if (proxyClient.isDead()) {
return "";
}
return "";
}
//long time = plotter.getLastTimeStamp();
if (committed > 0L) {
}
if (max > 0L) {
}
if (threshold > 0L) {
}
try {
boolean descPrinted = false;
if (!descPrinted) {
descPrinted = true;
} else {
}
}
} catch (IOException e) {
}
return text;
}
gc();
}
}
boolean isHeap;
int barX;
this.objectName = objectName;
setAccessibleName(this,
name));
}
return name;
}
}
implements Accessible, MouseListener {
Rectangle nonHeapRect = new Rectangle(leftMargin + groupGap, height - bottomMargin + 6, barWidth, 20);
public PoolChart() {
setFocusable(true);
addMouseListener(this);
}
if (poolPlotter.isHeap) {
nHeapPools++;
} else {
}
} else {
}
repaint();
}
if (max > 0L) {
// Paint green background
if (threshold > 0L) {
// Paint red background
// Over threshold, paint red bar
}
}
// Paint green bar
}
}
super.paintComponent(g);
return;
}
}
// Paint background for chart area
g.setColor(getBackground());
Rectangle r = g.getClipBounds();
// Paint percentage axis
g.setColor(getForeground());
g.drawString(str,
}
paintPoolBar(g, poolPlotter);
}
if (poolPlotter.isHeap) {
} else {
}
}
}
g.setColor(nonHeapColor);
g.drawString(str, x, y);
g.drawString(str, x, y);
// Highlight current plotter
r = null;
if (plotter == heapPlotter) {
r = heapRect;
} else if (plotter == nonHeapPlotter) {
r = nonHeapRect;
} else if (plotter instanceof PoolPlotter) {
}
if (r != null) {
}
}
}
height);
}
repaint();
}
}
}
} else if (nonHeapRect.contains(p)) {
} else {
break;
}
}
}
return plotter;
}
if (accessibleContext == null) {
accessibleContext = new AccessiblePoolChart();
}
return accessibleContext;
}
// Assume format string ends with newline
keyValueList +=
keyValueList +=
} else {
keyValueList +=
}
}
}
}
}
}
if (overviewPanel == null) {
overviewPanel = new MemoryOverviewPanel();
}
return new OverviewPanel[] { overviewPanel };
}
}
formatBytes(used, true),
formatBytes(committed, true),
formatBytes(max, true)));
}
}
}