Multiple recordings

Markus Gronlund markus.gronlund at oracle.com
Mon Jun 10 17:42:12 UTC 2019


Hi Milan,

Yes, this is the expected behavior.

Concurrent recordings are multiplexed into a single data stream. The set of recorded events is the union of the settings for all concurrent recordings. 

Therefore you can see more events than you might expect (but never less).

Thanks
Markus

-----Original Message-----
From: Milan Mimica <milan.mimica at gmail.com> 
Sent: den 10 juni 2019 16:14
To: hotspot-jfr-dev at openjdk.java.net
Subject: Multiple recordings

Hello List

I have noticed that when multiple recordings are running concurrently their events get merged in the dump.

Consider this example. It will print many events other than ObjectAllocationOutsideTLAB.

    public static void main(String[] args) throws Exception {
        var rec1 = new Recording(Configuration.getConfiguration("default"));
        rec1.start();

        var rec2 = new
Recording(Map.of("jdk.ObjectAllocationOutsideTLAB#enabled", "true"));
        rec2.start();

        Thread.sleep(2000);

        var path = new File("dump.jfr").toPath();
        rec2.dump(path);
        RecordingFile.readAllEvents(path).forEach(System.out::println);

        rec1.stop();
        rec2.stop();
    }

Is this a known limitation?

--
Milan Mimica


More information about the hotspot-jfr-dev mailing list