< prev index next >

src/jdk.management/share/classes/com/sun/management/ThreadMXBean.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 107,123 **** */ public long[] getThreadUserTime(long[] ids); /** * Returns an approximation of the total amount of memory, in bytes, ! * allocated in heap memory for the thread of the specified ID. * The returned value is an approximation because some Java virtual machine * implementations may use object allocation mechanisms that result in a * delay between the time an object is allocated and the time its size is * recorded. * <p> ! * If the thread of the specified ID is not alive or does not exist, * this method returns {@code -1}. If thread memory allocation measurement * is disabled, this method returns {@code -1}. * A thread is alive if it has been started and has not yet died. * <p> * If thread memory allocation measurement is enabled after the thread has --- 107,154 ---- */ public long[] getThreadUserTime(long[] ids); /** * Returns an approximation of the total amount of memory, in bytes, ! * allocated in heap memory for the current thread. * The returned value is an approximation because some Java virtual machine * implementations may use object allocation mechanisms that result in a * delay between the time an object is allocated and the time its size is * recorded. * <p> ! * If thread memory allocation measurement is disabled, this method returns ! * {@code -1}. ! * <p> ! * If thread memory allocation measurement is enabled after the current thread ! * has started, the Java virtual machine implementation may choose any time up ! * to and including the time that the capability is enabled as the point ! * where thread memory allocation measurement starts. ! * ! * @return an approximation of the total memory allocated, in bytes, in ! * heap memory for the current thread ! * if thread memory allocation measurement is enabled; ! * {@code -1} otherwise. ! * ! * @throws java.lang.UnsupportedOperationException if the Java virtual ! * machine implementation does not support thread memory allocation ! * measurement. ! * ! * @see #isThreadAllocatedMemorySupported ! * @see #isThreadAllocatedMemoryEnabled ! * @see #setThreadAllocatedMemoryEnabled ! */ ! public long getCurrentThreadAllocatedBytes(); ! ! /** ! * Returns an approximation of the total amount of memory, in bytes, ! * allocated in heap memory for the thread with the specified ID. ! * The returned value is an approximation because some Java virtual machine ! * implementations may use object allocation mechanisms that result in a ! * delay between the time an object is allocated and the time its size is ! * recorded. ! * <p> ! * If the thread with the specified ID is not alive or does not exist, * this method returns {@code -1}. If thread memory allocation measurement * is disabled, this method returns {@code -1}. * A thread is alive if it has been started and has not yet died. * <p> * If thread memory allocation measurement is enabled after the thread has
*** 125,136 **** * to and including the time that the capability is enabled as the point * where thread memory allocation measurement starts. * * @param id the thread ID of a thread * @return an approximation of the total memory allocated, in bytes, in ! * heap memory for a thread of the specified ID ! * if the thread of the specified ID exists, the thread is alive, * and thread memory allocation measurement is enabled; * {@code -1} otherwise. * * @throws IllegalArgumentException if {@code id} {@code <=} {@code 0}. * @throws java.lang.UnsupportedOperationException if the Java virtual --- 156,167 ---- * to and including the time that the capability is enabled as the point * where thread memory allocation measurement starts. * * @param id the thread ID of a thread * @return an approximation of the total memory allocated, in bytes, in ! * heap memory for the thread with the specified ID ! * if the thread with the specified ID exists, the thread is alive, * and thread memory allocation measurement is enabled; * {@code -1} otherwise. * * @throws IllegalArgumentException if {@code id} {@code <=} {@code 0}. * @throws java.lang.UnsupportedOperationException if the Java virtual
< prev index next >