equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
180 try { |
180 try { |
181 HeapGraphWriter hgw = new HeapHprofBinWriter(); |
181 HeapGraphWriter hgw = new HeapHprofBinWriter(); |
182 hgw.write(fileName); |
182 hgw.write(fileName); |
183 System.out.println("heap written to " + fileName); |
183 System.out.println("heap written to " + fileName); |
184 return true; |
184 return true; |
185 } catch (IOException | RuntimeException exp) { |
185 } catch (IOException exp) { |
186 System.err.println(exp.getMessage()); |
186 throw new RuntimeException(exp); |
187 return false; |
|
188 } |
187 } |
189 } |
188 } |
190 |
189 |
191 public boolean writeHeapHprofBin() { |
190 public boolean writeHeapHprofBin() { |
192 return writeHeapHprofBin("heap.bin"); |
191 return writeHeapHprofBin("heap.bin"); |
197 HeapGraphWriter hgw = new HeapGXLWriter(); |
196 HeapGraphWriter hgw = new HeapGXLWriter(); |
198 hgw.write(fileName); |
197 hgw.write(fileName); |
199 System.out.println("heap written to " + fileName); |
198 System.out.println("heap written to " + fileName); |
200 return true; |
199 return true; |
201 } catch (IOException exp) { |
200 } catch (IOException exp) { |
202 System.err.println(exp.getMessage()); |
201 throw new RuntimeException(exp); |
203 return false; |
|
204 } |
202 } |
205 } |
203 } |
206 |
204 |
207 public boolean writeHeapGXL() { |
205 public boolean writeHeapGXL() { |
208 return writeHeapGXL("heap.xml"); |
206 return writeHeapGXL("heap.xml"); |