Skip to content

Commit

Permalink
Merge pull request #8302 from s1ck/all-mac-workaround-2.5
Browse files Browse the repository at this point in the history
Extend intel-Mac-Azul workaround to all-Mac
  • Loading branch information
s1ck authored Nov 1, 2023
2 parents 28b8734 + 8d8f6c7 commit f3a4655
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
9 changes: 9 additions & 0 deletions doc/modules/ROOT/pages/installation/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ For example, exporting graphs xref:management-ops/graph-export/graph-export-csv.
You can find the list of all the configuration options xref:production-deployment/configuration-settings.adoc[here].
Refer to the <<_installation_methods,installation methods>> for details on how to edit a Neo4j database configuration depending on the Neo4j deployment.

== Graph Data Science on MacOS

If you are running MacOS (x86 or ARM), it is currently required to add the following configuration entry to `neo4j.conf`:

----
server.jvm.additional=-Djol.skipHotspotSAAttach=true
----


== Reference

* xref:installation/supported-neo4j-versions.adoc[Supported Neo4j versions]
Expand Down
4 changes: 1 addition & 3 deletions doc/modules/ROOT/pages/installation/neo4j-desktop.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ If the procedure allowlist is configured, make sure to also include procedures f
dbms.security.procedures.allowlist=gds.*
----

If you are running MacOS on an intel CPU, it is required to add the following configuration entry to the configuration:
If you are running MacOS (x86 or ARM), it is required to add the following configuration entry to the configuration:

----
server.jvm.additional=-Djol.skipHotspotSAAttach=true
----

This is a workaround for a bug in the Java runtime that is used by Neo4j Desktop.
13 changes: 5 additions & 8 deletions memory-usage/src/main/java/org/neo4j/gds/mem/MemoryUsage.java
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ private static final class VmInfoHolder {
*/
@SuppressForbidden(reason = "we want to use system.out here")
private static boolean isVmInfoAvailable() {
intelMacWorkaround();
macWorkaround();

var sysOut = System.out;
try {
Expand All @@ -389,19 +389,16 @@ private static boolean isVmInfoAvailable() {
}

/**
* JOL currently gets stuck on Azul Zulu 17.44.53-ca-jdk17.0.8.1 on Intel Macs.
* JOL currently kills the JVM on Mac OS X when trying to attach to the Hotspot SA.
* This happens with several JVMs (Java.net, Azul) and on both platforms (x86, ARM).
* <p>
* We can work around this by skipping the Hotspot SA attach.
* See <a href="https://bugs.openjdk.org/browse/CODETOOLS-7903447">OpenJDK issue</a>
* </p>
*/
@Deprecated(forRemoval = true)
private static void intelMacWorkaround() {
var isAzul = System.getProperty("java.vendor").contains("Azul Systems");
var isIntel = System.getProperty("os.arch").contains("x86_64");
var isMac = System.getProperty("os.name").contains("Mac");

if (isAzul && isIntel && isMac) {
private static void macWorkaround() {
if (System.getProperty("os.name").contains("Mac")) {
System.setProperty("jol.skipHotspotSAAttach", "true");
}
}
Expand Down

0 comments on commit f3a4655

Please sign in to comment.