< prev index next >

test/serviceability/dcmd/compiler/CodeCacheTest.java

Print this page




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test CodeCacheTest
  26  * @bug 8054889
  27  * @library /testlibrary
  28  * @modules java.base/jdk.internal.misc
  29  *          java.compiler
  30  *          java.management
  31  *          jdk.jvmstat/sun.jvmstat.monitor
  32  * @build jdk.test.lib.*
  33  * @build jdk.test.lib.dcmd.*
  34  * @run testng/othervm -XX:+SegmentedCodeCache CodeCacheTest
  35  * @run testng/othervm -XX:-SegmentedCodeCache CodeCacheTest
  36  * @run testng/othervm -Xint -XX:+SegmentedCodeCache CodeCacheTest
  37  * @summary Test of diagnostic command Compiler.codecache
  38  */
  39 
  40 import org.testng.annotations.Test;
  41 import org.testng.Assert;
  42 
  43 import jdk.test.lib.OutputAnalyzer;
  44 import jdk.test.lib.dcmd.CommandExecutor;
  45 import jdk.test.lib.dcmd.JMXExecutor;
  46 
  47 import java.util.Iterator;
  48 import java.util.regex.Matcher;
  49 import java.util.regex.Pattern;
  50 
  51 public class CodeCacheTest {
  52 
  53     /**
  54      * This test calls Jcmd (diagnostic command tool) Compiler.codecache and then parses the output,
  55      * making sure that all numbers look ok
  56      *
  57      *
  58      * Expected output without code cache segmentation:
  59      *
  60      * CodeCache: size=245760Kb used=4680Kb max_used=4680Kb free=241079Kb
  61      * bounds [0x00007f5bd9000000, 0x00007f5bd94a0000, 0x00007f5be8000000]
  62      * total_blobs=575 nmethods=69 adapters=423
  63      * compilation: enabled




   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /*
  25  * @test CodeCacheTest
  26  * @bug 8054889
  27  * @library /test/lib
  28  * @modules java.base/jdk.internal.misc
  29  *          java.compiler
  30  *          java.management
  31  *          jdk.jvmstat/sun.jvmstat.monitor


  32  * @run testng/othervm -XX:+SegmentedCodeCache CodeCacheTest
  33  * @run testng/othervm -XX:-SegmentedCodeCache CodeCacheTest
  34  * @run testng/othervm -Xint -XX:+SegmentedCodeCache CodeCacheTest
  35  * @summary Test of diagnostic command Compiler.codecache
  36  */
  37 
  38 import org.testng.annotations.Test;
  39 import org.testng.Assert;
  40 
  41 import jdk.test.lib.process.OutputAnalyzer;
  42 import jdk.test.lib.dcmd.CommandExecutor;
  43 import jdk.test.lib.dcmd.JMXExecutor;
  44 
  45 import java.util.Iterator;
  46 import java.util.regex.Matcher;
  47 import java.util.regex.Pattern;
  48 
  49 public class CodeCacheTest {
  50 
  51     /**
  52      * This test calls Jcmd (diagnostic command tool) Compiler.codecache and then parses the output,
  53      * making sure that all numbers look ok
  54      *
  55      *
  56      * Expected output without code cache segmentation:
  57      *
  58      * CodeCache: size=245760Kb used=4680Kb max_used=4680Kb free=241079Kb
  59      * bounds [0x00007f5bd9000000, 0x00007f5bd94a0000, 0x00007f5be8000000]
  60      * total_blobs=575 nmethods=69 adapters=423
  61      * compilation: enabled


< prev index next >