/*
* 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.
*
* 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.
*
*/
#include "runtime/mutexLocker.hpp"
#include "services/memBaseline.hpp"
#include "services/memTracker.hpp"
#include "utilities/ostream.hpp"
/*
* MemBaselineReporter reports data to this outputer class,
* ReportOutputer is responsible for format, store and redirect
* the data to the final destination.
*/
public:
// start to report memory usage in specified scale.
// if report_diff = true, the reporter reports baseline comparison
// information.
// Done reporting
virtual void done() = 0;
/* report baseline summary information */
size_t total_committed) = 0;
/* report baseline summary comparison */
int reserved_diff,
int committed_diff) = 0;
int stack_reserved_diff, int stack_committed_diff) = 0;
/*
* memory summary by memory types.
* for each memory type, following summaries are reported:
* - reserved amount, committed amount
* - malloc'd amount, malloc count
* - arena amount, arena count
*/
// start reporting memory summary by memory type
virtual void start_category_summary() = 0;
int malloc_count_diff, int arena_diff,
int arena_count_diff) = 0;
virtual void done_category_summary() = 0;
virtual void start_virtual_memory_map() = 0;
virtual void reserved_memory_region(MEMFLAGS type, address base, address end, size_t size, address pc) = 0;
virtual void done_virtual_memory_map() = 0;
/*
* Report callsite information
*/
virtual void start_callsite() = 0;
int malloc_diff, int malloc_count_diff) = 0;
virtual void diff_virtual_memory_callsite(address pc, size_t cur_reserved_amt, size_t cur_committed_amt,
int reserved_diff, int committed_diff) = 0;
virtual void done_callsite() = 0;
// return current scale in "KB", "MB" or "GB"
};
/*
* This class reports processed data from a baseline or
* the changes between the two baseline.
*/
private:
public:
// construct a reporter that reports memory usage
// in specified scale
}
bool summary_only = false);
private:
// calculate memory size in current memory scale
// diff two unsigned values in current memory scale
// diff two unsigned value
};
/*
* tty output implementation. Native memory tracking
* DCmd uses this outputer.
*/
private:
int _num_of_classes_diff;
int _num_of_threads_diff;
public:
_scale = K;
_num_of_classes = 0;
_num_of_threads = 0;
_num_of_classes_diff = 0;
_num_of_threads_diff = 0;
}
// begin reporting memory usage in specified scale
// done reporting
void done();
// total memory usage
// report total loaded classes
}
}
}
int reserved_diff,
int committed_diff);
}
}
int stack_reserved_diff, int stack_committed_diff) {
}
/*
* Report memory summary categoriuzed by memory types.
* For each memory type, following summaries are reported:
* - reserved amount, committed amount
* - malloc-ed amount, malloc count
* - arena amount, arena count
*/
// start reporting memory summary by memory type
void start_category_summary();
int malloc_count_diff, int arena_diff,
int arena_count_diff);
void done_category_summary();
// virtual memory map
void start_virtual_memory_map();
void done_virtual_memory_map();
/*
* Report callsite information
*/
void start_callsite();
int malloc_diff, int malloc_count_diff);
int reserved_diff, int committed_diff);
void done_callsite();
};
#endif // SHARE_VM_SERVICES_MEM_REPORTER_HPP