Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8333769

Pretouching tests dont test pretouching

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 24
    • hotspot
    • None
    • gc
    • b03

      JDK-8324781 showed that we need a test that makes sure pretouching works.

      The error was caused by a kernel problem with UEK kernels that prevented os::pretouch_memory from working correctly. The only test picking up on that was runtime/Thread/TestAlwaysPreTouchStacks.java. But that's not even its job, all it wants to do is to test the AlwaysPreTouchStacks option.

      We have a bunch of AlwaysPreTouch tests (GC specific, and not for every GC, e.g. test/hotspot/jtreg/gc/epsilon/TestAlwaysPretouch.java, test/hotspot/jtreg/gc/x/TestAlwaysPreTouch.java, same for z, and one for Shenandoah.)

      All of them do the same: the start the JVM with AlwaysPreTouch, then do nothing. The VM coming up is proof it works. But that is not enough, we should - at least on Linux where this is easily possible - test that we actually pretouch, by observing RSS. Note that TestAlwaysPreTouchStacks.java does that via the inbuilt NMT capability to measure live memory in stacks, that won't work here. We will have to scan /proc/self/status (I think restricting this test to linux for now is fine).

      Therefore, I propose:

      - start JVMs with Xint, and with a reasonably large heap. E.g. 512MB or 1G.
      - when the VM is up, check RSS. It should be larger than the amount we pretouched.

      I think also that these tests could be unified for all GCs, and also ran for Serial, Parallel and G1.

            szaldana Sonia Zaldana Calles
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: