Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Threads parameter is not working on Apple Silicon #770

Closed
orpiske opened this issue Jan 10, 2023 · 5 comments
Closed

Threads parameter is not working on Apple Silicon #770

orpiske opened this issue Jan 10, 2023 · 5 comments

Comments

@orpiske
Copy link

orpiske commented Jan 10, 2023

Obs.: I'm opening a ticket for an issue I noticed while the support for M1 was not yet official. I noticed that this still seem to be happening. Back then, I wrote the following report:

    I know support is not official yet, but sharing my experience in the hope it will eventually be useful for when there is an official release. 

One thing I noticed is that the build for ARM doesn't seem to respect the mvnd.threads setting or the -T flag. Using -T 0.5C here, still causes it to use all cores.

Screenshot 2022-04-04 at 11 16 53

Originally posted by @orpiske in #337 (comment)

@gnodet
Copy link
Contributor

gnodet commented Jan 18, 2023

Can you reproduce the issue ?
Are you sure you don't have the mvnd.threads property set in one of the configuration file ?
It seems to work correctly for me...

@orpiske
Copy link
Author

orpiske commented Jan 21, 2023

@gnodet my [USER_HOME]/.m2/mvnd.properties has mvnd.threads=0.5C. My understanding is that it would use half of the available cores by default. Is there something else I should look at that could be affecting this?

@gnodet
Copy link
Contributor

gnodet commented Jan 24, 2023

I've set my [USER_HOME]/.m2/mvnd.properties to add mvnd.threads=0.5C and it works fine for me.
Can you check your environment maybe using set | grep MAVEN ?
mvnd also checks the [PROJECT_HOME]/.mvn/mvnd.properties and [MVND_HOME]/conf/mvnd.properties...

@orpiske
Copy link
Author

orpiske commented Jan 24, 2023

@gnodet thanks. This is what I have:

MAVEN_OPTS=-Xms2048m -Xmx3584m
MAVEN_HOME=/Users/opiske/.sdkman/candidates/maven/current

My mvnd.properties from MVND_HOME seems to use the default values:

cat $MVND_HOME/conf/mvnd.properties | grep -i thread
# MVND_MIN_THREADS
# The minimum number of threads to use when constructing the default {@code -T} parameter for the daemon.
# This value is ignored if @{@code -T}, @{@code --threads} or {@code -Dmvnd.threads} is specified on the command
# line, or if {@code mvnd.threads} is specified in {@code ~/.m2/mvnd.properties}.
# mvnd.minThreads = 1
# MVND_THREADS
# The number of threads to pass to the daemon; same syntax as Maven's {@code -T}/{@code --threads} option. Ignored
# if the user passes @{@code -T}, @{@code --threads} or {@code -Dmvnd.threads} on the command
# mvnd.threads =
# MVND_THREAD_STACK_SIZE
# JVM options for the daemon to specify the thread stack size
# mvnd.threadStackSize = 1M

And looking at one of my projects, this is what I have:

ls ~/code/java/camel/.mvn
extensions.xml  jvm.config      wrapper/

@orpiske
Copy link
Author

orpiske commented Feb 15, 2023

I think I know where the problem may be: the log message correctly displays the scaled down number of threads as I adjust the setting, however the CPU load pattern on both htop and on Activity Monitor seems to imply that the load is happening on all Cores.

I am not sure if the problem is indeed w/ Maven Daemon. Maybe it's something specific about how the scheduler distributes the load on this OS/platform.

So, I think we can close this @gnodet.

@orpiske orpiske closed this as completed Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants