Skip to content

Mac Silicon: crazy CPU load around 70% #4215

Closed

Description

@owpk

Description

I’m developing a typical Spring Boot application.
For privacy reasons, I can’t share the project’s source code, but I can provide the Gradle build file to give an idea of the dependencies and structure.

After running the application for some time, I noticed that CPU usage remains constantly high — around 70%, caused by the Java process.
The issue is consistent and reproducible. According to the profiler, the high CPU load originates from:

org.eclipse.equinox.launcher_1.7.0.v20250519-0528.jar
Image

The CPU stays at around 70% usage constantly, even when the application is idle and nothing happens.

Image

Environment

OS: (macOS Tahoe 26.0.1)

Java version:
openjdk version "21.0.2" 2024-01-16
OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30)
OpenJDK 64-Bit Server VM GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30, mixed mode, sharing)

redhat.java version: 1.46.0

gradle.build

plugins {
	id 'java'
	id 'org.springframework.boot' version '3.5.3'
	id 'io.spring.dependency-management' version '1.1.7'
   	id 'eclipse'
}

group = 'owpk'
version = '0.0.1-SNAPSHOT'

java {
	toolchain {
		languageVersion = JavaLanguageVersion.of(21)
	}
}

configurations {
	compileOnly {
		extendsFrom annotationProcessor
	}
}

repositories {
	mavenCentral()
}

ext {
	set('sentryVersion', "8.16.0")
}

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-quartz'
	implementation 'org.springframework.boot:spring-boot-starter-security'
	implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
	implementation 'org.springframework.boot:spring-boot-starter-web'

	implementation 'org.telegram:telegrambots-spring-boot-starter:6.9.7.1'
	implementation 'org.telegram:telegrambots-client:9.0.0'

	implementation 'org.liquibase:liquibase-core'
	implementation 'io.sentry:sentry-spring-boot-starter-jakarta'
	runtimeOnly 'org.postgresql:postgresql'

	implementation 'io.vavr:vavr:0.10.6'
	implementation 'org.apache.commons:commons-lang3:3.14.0'
	compileOnly 'org.projectlombok:lombok'
	developmentOnly 'org.springframework.boot:spring-boot-devtools'
	annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
	annotationProcessor 'org.projectlombok:lombok'

	testImplementation 'org.springframework.boot:spring-boot-starter-test'
	testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

}

dependencyManagement {
	imports {
		mavenBom "io.sentry:sentry-bom:${sentryVersion}"
	}
}

tasks.named('test') {
	useJUnitPlatform()
}

extension host logs:

2025-10-21 20:59:00.405 [warning] vscjava.vscode-lombok - Code actions of kind 'source.fixAll' requested but returned code action is of kind 'refactor'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
2025-10-21 20:59:14.686 [error] [redhat.java] provider FAILED
2025-10-21 20:59:14.686 [error] Error: The request (id: 2286, method: 'textDocument/documentSymbol') has been cancelled
    at /Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1078118
    at re (/Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1078412)
    at /Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1073196
    at Immediate.<anonymous> (/Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1073216)
    at processImmediate (node:internal/timers:485:21)
2025-10-21 20:59:15.079 [error] Error: The request (id: 2287, method: 'workspace/executeCommand') has been cancelled
    at /Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1078118
    at re (/Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1078412)
    at /Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1073196
    at Immediate.<anonymous> (/Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1073216)
    at processImmediate (node:internal/timers:485:21) java.execute.workspaceCommand {"value":"redhat.java","_lower":"redhat.java"}
2025-10-21 20:59:21.852 [error] [redhat.java] provider FAILED
2025-10-21 20:59:21.852 [error] Error: The request (id: 2304, method: 'textDocument/documentSymbol') has been cancelled
    at /Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1078118
    at re (/Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1078412)
    at /Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1073196
    at Immediate.<anonymous> (/Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1073216)
    at processImmediate (node:internal/timers:485:21)
2025-10-21 20:59:40.848 [error] onWillSaveTextDocument-listener from extension 'redhat.java' threw ERROR
2025-10-21 20:59:40.848 [error] Error: timeout
    at Timeout._onTimeout (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:142:105371)
    at listOnTimeout (node:internal/timers:588:17)
    at processTimers (node:internal/timers:523:7)
2025-10-21 20:59:40.849 [warning] vscjava.vscode-lombok - Code actions of kind 'source.fixAll' requested but returned code action is of kind 'refactor'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.
2025-10-21 21:12:58.085 [info] ExtensionService#_doActivateExtension naco-siren.gradle-language, startup: false, activationEvent: 'onLanguage:gradle'
2025-10-21 21:14:22.624 [error] [redhat.java] provider FAILED
2025-10-21 21:14:22.624 [error] Error: Internal error.
    at /Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1078118
    at re (/Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1078412)
    at /Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1073196
    at Immediate.<anonymous> (/Users/slavavorobev/.vscode/extensions/redhat.java-1.46.0-darwin-arm64/dist/extension.js:2:1073216)
    at processImmediate (node:internal/timers:485:21)

Activity

  1. fbricon commented on Oct 21, 2025

    @fbricon
    Collaborator

    can you take 3-4 thread dumps (e.g. jstack 67127), 30s apart, so we can try to identify which part of the process is misbehaving?

  2. fbricon commented on Oct 21, 2025

    @fbricon
    Collaborator

    you have a vscjava.vscode-lombok extension that should be removed, as its functionality is now built-into vscode-java. It might cause some unwanted behavior.

  3. fbricon commented on Oct 21, 2025

    @fbricon
    Collaborator

    actually vscode-lombok still has some extra features you might want to keep, but the basic one (enabling lombok generation) is indeed built-into vscode-java

  4. owpk commented on Oct 21, 2025

    @owpk
    Author

    @fbricon

    Thank you for looking into this — I really like this extension!

    You’re right, i realize that I’ve also noticed some unusual behavior when using Lombok features


    The PID has changed, but the issue reappeared almost immediately.
    Here’s the sequence of commands I used to capture the thread dumps:

    jstack -l 95831 > thread-dump-1.txt
    sleep 30
    jstack -l 95831 > thread-dump-2.txt
    sleep 30
    jstack -l 95831 > thread-dump-3.txt
    sleep 30
    jstack -l 95831 > thread-dump-4.txt

    Here are the resulting thread dumps:

    thread-dump-1.txt
    thread-dump-2.txt
    thread-dump-3.txt
    thread-dump-4.txt

  5. fbricon commented on Oct 21, 2025

    @fbricon
    Collaborator

    Looks like the language server is stuck looking for references. Can you try setting java.referencesCodeLens.enabled to false, maybe restart vscode?

  6. owpk commented on Oct 21, 2025

    @owpk
    Author

    I usually restart VS Code when this issue occurs, but it reappears almost immediately after restarting.
    I’ve deleted the Lombok extension and disabled References CodeLens. I’ll see what changes.

  7. owpk commented on Oct 21, 2025

    @owpk
    Author

    nothing changes

    Image

    here are the thread dumps again:

    ❯ jstack -l 27457 > thread-dump-5.txt
    sleep 30
    jstack -l 27457 > thread-dump-6.txt
    sleep 30
    jstack -l 27457 > thread-dump-7.txt
    sleep 30
    jstack -l 27457 > thread-dump-8.txt

    thread-dump-5.txt
    thread-dump-6.txt
    thread-dump-7.txt
    thread-dump-8.txt

    also i have this:

    Image
  8. fbricon commented on Oct 21, 2025

    @fbricon
    Collaborator

    Garbage collection stressing the CPU due to insufficient memory might be cause for the freezes. Have you tried increasing memory?
    How big is your project? how many java files and lines of code? You can use :

    brew install cloc
    cloc --include-lang=Java .

  9. fbricon commented on Oct 21, 2025

    @fbricon
    Collaborator

    other things you can try :

    • disabling inlay hints
    • enable vscode-gradle's build server with java.gradle.buildServer.enabled (that will probably require running the Java: Clean Java Language Server Workspace command)
  10. owpk commented on Oct 21, 2025

    @owpk
    Author
    ❯ cloc --include-lang=Java .
         217 text files.
         179 unique files.
         479 files ignored.
    
    github.com/AlDanial/cloc v 2.06  T=0.13 s (1133.5 files/s, 49122.8 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    Java                           149           1144            362           4951
    -------------------------------------------------------------------------------
    SUM:                           149           1144            362           4951
    -------------------------------------------------------------------------------
    

    OK, I’ll try to increase the memory. What -Xmx/-Xms values would you suggest?

  11. fbricon commented on Oct 21, 2025

    @fbricon
    Collaborator

    that really is a small project, there's something really odd here.
    You can click on the Increase Memory... button, it'll double the current memory values (-Xmx2G -Xms100m by default) but if there's a memory leak, it won't matter much.

    Also, can you force the lombok version to the latest version (1.18.42) and select it from the Java status:

    Image
  12. owpk commented on Oct 21, 2025

    @owpk
    Author

    I’ve increased the memory, and so far it seems there are no issues anymore.

    ❯ ps -p $(jps | grep equinox.launcher | awk '{print $1}')  -o %cpu,%mem
     %CPU %MEM
      0.0  2.2
    Image

    I also tried what you suggested: up Lombok to 1.18.42, disabled inlay hints, and enabled the Gradle build server.

    I guess thanks!

  13. fbricon commented on Oct 21, 2025

    @fbricon
    Collaborator

    you can probably try to reenable inlayhints, then codelens, one at a time to see if it still works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions