Skip to content

Commit 238370d

Browse files
s1ckknutwalker
andcommitted
Skip ServiceAvailablity Agent attach on intel+mac+azul
Co-Authored-By: Paul Horn <paul.horn@neotechnology.com>
1 parent bc04a12 commit 238370d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

memory-usage/src/main/java/org/neo4j/gds/mem/MemoryUsage.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ private static final class VmInfoHolder {
372372
*/
373373
@SuppressForbidden(reason = "we want to use system.out here")
374374
private static boolean isVmInfoAvailable() {
375+
intelMacWorkaround();
376+
375377
var sysOut = System.out;
376378
try {
377379
var swallowSysOut = new PrintStream(NullOutputStream.NULL_OUTPUT_STREAM, true, StandardCharsets.UTF_8);
@@ -386,6 +388,24 @@ private static boolean isVmInfoAvailable() {
386388
}
387389
}
388390

391+
/**
392+
* JOL currently gets stuck on Azul Zulu 17.44.53-ca-jdk17.0.8.1 on Intel Macs.
393+
* <p>
394+
* We can work around this by skipping the Hotspot SA attach.
395+
* See <a href="https://bugs.openjdk.org/browse/CODETOOLS-7903447">OpenJDK issue</a>
396+
* </p>
397+
*/
398+
@Deprecated(forRemoval = true)
399+
private static void intelMacWorkaround() {
400+
var isAzul = System.getProperty("java.vendor").contains("Azul Systems");
401+
var isIntel = System.getProperty("os.arch").contains("x86_64");
402+
var isMac = System.getProperty("os.name").contains("Mac");
403+
404+
if (isAzul && isIntel && isMac) {
405+
System.setProperty("jol.skipHotspotSAAttach", "true");
406+
}
407+
}
408+
389409
private static final class NullOutputStream extends OutputStream {
390410

391411
static final OutputStream NULL_OUTPUT_STREAM = new NullOutputStream();

0 commit comments

Comments
 (0)