aprofiler.cpp revision 0
/*
* Copyright 1997-2002 Sun Microsystems, Inc. All Rights Reserved.
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
# include "incls/_precompiled.incl"
# include "incls/_aprofiler.cpp.incl"
bool AllocationProfiler::_active = false;
class AllocProfClosure : public ObjectClosure {
public:
}
};
#ifndef PRODUCT
class AllocProfResetClosure : public ObjectClosure {
public:
k->set_alloc_count(0);
k->set_alloc_size(0);
}
}
};
#endif
void AllocationProfiler::iterate_since_last_gc() {
if (is_active()) {
}
}
void AllocationProfiler::engage() {
_active = true;
}
void AllocationProfiler::disengage() {
_active = false;
}
_print_array->append(k);
}
// Iterate over klass and all array klasses for klass
}
// Sort by total allocation size
}
}
"__Instances"
"__Average"
"__Class________________");
size_t total_alloc_size = 0;
int total_alloc_count = 0;
if (alloc_size > cutoff) {
#ifdef PRODUCT
#else
#endif
name);
}
}
}
// Print regular instance klasses and basic type array klasses
#ifndef PRODUCT
tty->print_cr("Allocation profile for system classes (sizes in bytes, cutoff = %d bytes):", cutoff * BytesPerWord);
// Print system klasses (methods, symbols, constant pools, etc.)
tty->print_cr("Permanent generation dump (sizes in bytes, cutoff = %d bytes):", cutoff * BytesPerWord);
#endif
}