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

IBM Java 7 is slow in WSL #2738

Closed
SOM-fermonte opened this issue Dec 8, 2017 · 5 comments
Closed

IBM Java 7 is slow in WSL #2738

SOM-fermonte opened this issue Dec 8, 2017 · 5 comments

Comments

@SOM-fermonte
Copy link

Hello, I tried to install IBM Java SDK on my WSL system. I tried both installation types supported by IBM (with and without root, as seen in the IBM SDK 7 Downloads) and both result in the same problem: executing java is very slow. For example, java -version takes a long time.

I am running Windows 10 Enterprise (1703 build 15063.729) and the output of lsb_release -a is

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial

I am attaching the output of strace -fT java -version, in case that helps in the investigation. I will be happy to troubleshoot as well, if you have additional questions.

Thanks!
ibm_java.zip

@therealkenc
Copy link
Collaborator

therealkenc commented Dec 8, 2017

+1 ⭐ for the -fT flag on your strace (we don't get that a lot around here)

$ grep 536870912 ibm_java.strace | wc
  12936  103488 1127530
$ grep 209715200 ibm_java.strace | wc
 275080 2200639 24137133

The lines in the strace look like

133   mmap(0x2000, 536870912, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x7f03e0fe0000 <0.011723>

13k mmap/munmaps of 512MiB and 275k mmap/munmaps of 200MiB will bring the hurt on WSL right now. ~110ms a call for the half gig. This is #1671 #708 et al. If you have a Real Linux™ box handy and have comparative stats for those calls it would be (academically) nice to have on hand.

[It is still bothersome to me in an irrational kind of way that it takes a quarter million mmap calls to print a version string in 2017. When I was writing Java code in 1997 we had to walk up hill in the snow to the 160 megabyte SPARCstation, and we didn't complain about it. Also, get off my lawn.]

@SOM-fermonte
Copy link
Author

Thanks for looking into this. Unfortunately, the closest I have to a Linux box is a VM running on the same pc as WSL. The results I am attaching are from a VM in VirtualBox with an Ubuntu 16.04.3 LTS guest, the host, is the machine mentioned above.

The difference is dramatic between the two, but since the VM is so memory hungry, I was hoping to do away with it and use WSL for Java development. Given that this is a duplicate, is there hope this might get resolved in the near future? (I haven't finished going through the threads yet)

Thanks!
ibm_java_VM.zip

@therealkenc
Copy link
Collaborator

therealkenc commented Dec 8, 2017

A VM is fine; appreciate the comparative strace. We don't really get 'near' or 'not so near' estimates. YRMV. But you'll see in the other posts the team is acutely aware that WSL performs poorly with the pattern. Subscribe to #1671 and you'll get an update if there is any news. This is more or less blocking the GHC people and probably golang people; your post was valuable in that it added Java into the mix. Thanks again for the concise OP.

@therealkenc
Copy link
Collaborator

Quick note: you are on 15063 and there were significant improvements in FCU 16299. So upgrade to that if you can and it might (might) be more tolerable.

@SOM-fermonte
Copy link
Author

Thanks for the follow-up. I have the issue on a corporate machine, so my hopes of being able to upgrade are remote :(

You made me curious, though, so I tried on a personal machine over the weekend. That PC has Win10 Insiders and there is a remarkable difference. It's still slow compared to a VM, but java -version runs in about 40 seconds, compared to several minutes.

At work, my only option remains the VM, but it is good to know that progress has been made already on this issue. It's also good to know a bit more about how things work under the hood. Helps to decide what to try and what not to try with WSL.

Thanks!!

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

No branches or pull requests

2 participants