• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

javac and java commands slow the first time

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello. Some months back, I switched from 32 bit Windows 7 to 64 bit Windows 10. I can't remember but I think I copied the Java directory from Program Files on Win 7 pc to Program Files in Win 10 and set the Path. Anyways, on the Win 10, the first time I javac and/or java in a windows session, it takes forever, then runs normally. Next day or next login, same deal. first time forever. Would anybody know what could be up? thank you so much. Oh, jvm 8.
 
Saloon Keeper
Posts: 8458
71
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java 8 comes in both a 32 bit flavor and a 64 bit flavor. Did you upgrade to the 64 bit?
 
Thomas Griffith
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Carey Brown wrote:Java 8 comes in both a 32 bit flavor and a 64 bit flavor. Did you upgrade to the 64 bit?



That's what I can't remember. Would it be in a Readme or is there a way to easily check? The Readme in the root points to some url.
 
Carey Brown
Saloon Keeper
Posts: 8458
71
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can type
java -version

it will tell you. If you are unsure, just uninstall both copies and reinstall the 64-bit version.
 
Thomas Griffith
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I java -version on the command line, I get the version but no bits. Googling tells me -version would indicate 64 bit if it is a 64 jvm and nothing if 32, so I guess it's a 32 bit jvm on 64 bit pc.
 
Carey Brown
Saloon Keeper
Posts: 8458
71
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have to reinstall anyway, I'd suggest Java-11, it has "long term support".
 
Thomas Griffith
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for your time, Carey. ugh. I'm still getting the huge delay the first time javac or java are run from command line. I cleaned out the Win 10 pc of the 32-bit jvm, pointed path to the 64-bit. Does anybody have any other ideas what this could be? javac/java run quickly and normally the rest of the session. I'm talking five minutes it takes, the fan kicks in, etc.  thank you
 
Rancher
Posts: 139
5
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I have the very same issue (but know what's causing it on my system): Do you have ANY security software installed other than what windows comes with?
If so: That's the to-be-expected behaviour on any file when accessed after restart.
I use Kaspersky Internet Security for years now - and hence I know from many tests that its active scanner is causing this. Why? The first time after boot the scanner actively scans anything required to fully start up a jvm. Starting from the second run the scanner only checks if any file was modified since last run. If not the file is assumed unchanged and hence skipped from a second scan.
You can test this by writing some lines which modifies the last write access timestamp - you'll see a lot of files gets rescanned every time just cause its modified flag was triggered.
The only other idea I can come up with is slow initial loading + caching for the rest of the active session. But that's too deep into the specific configuration of the system.
 
Carey Brown
Saloon Keeper
Posts: 8458
71
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or, worse yet, multiple virus checkers running at the same time.

Have you look at Window's performance monitor and task management data? Task management would give you some idea as to which process is taking up most of the CPU.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please do not use additional antivirus software on Windows 10, because they can only work by requesting a "hook" that is not as high in priority as the inbuild antivirus of Windows 10.
I recommand to uninstall your Antivirus and enable the standard Windows 10 antivirus with automatic update.

Then as others already mentioned you can tell your Antivirus to skip specific folders for scanning.

But it normaly it should not be so slow. Did you download your JDK from an official site?
 
Thomas Griffith
Ranch Hand
Posts: 86
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much for all the information guys. I javac'd with Task Manager on and it looks like a security scanner shoots up to 30-40% cpu usage during the five minute compile time. For fun, I'll try to make a change to the java file when it completes and javac again but it looks to be the cause or whatever. I guess the scanner runs as a background process across enterprise. This might explain some other weird "locking" and perceived "instability" with other programs.
 
Thomas Griffith
Ranch Hand
Posts: 86
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I modified the java code here and there, import different packages, and javac is instantaneous. So it seems that only the first time the file is javac/java'd in a session does the scanner get all over it.
 
Carey Brown
Saloon Keeper
Posts: 8458
71
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Every year a number of places compare and review virus scanning programs. It seems that in the last bunch (5+?) of years the top virus checkers pretty much catch identical sets of viruses with each catching a handful that the others do not. So, you might as well buy one based on features because you'll get roughly the same protection.

There is one place that these comparisons have shown a clear winner and that is in the virus checker's impact on system performance. There, Microsoft's free Defender virus check clearly stood out with the least  impact to system performance when performing its duties.

And, as already mentioned, you never want to run more that one of these at a time or your system impact will be horrible.
 
Thomas Griffith
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeah, personally, I've always just ran the default defender and had malwarebyes to run manually if anything weird surfaced.
 
Marshal
Posts: 73766
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Carey Brown wrote:. . . you never want to run more that one [virus checher] at a time or your system impact will be horrible.

Don't multiple virus checkers always interfere with one another?
 
Carey Brown
Saloon Keeper
Posts: 8458
71
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Carey Brown wrote:. . . you never want to run more that one [virus checher] at a time or your system impact will be horrible.

Don't multiple virus checkers always interfere with one another?

Yes, which is why it may be taking up to 5 minutes, which is a very long time for start up.
 
reply
    Bookmark Topic Watch Topic
  • New Topic