I was checking out a sample project of NetBeans IDE called "Stopwatch". Then ran it! Then I opened TaskManager to see how much RAM it uses. It was using ~110MB. Then I opened the "Alarms & Clock" app of Windows 10 to compare them. Amazingly, "Alarms & Clock" was using only 15MB. Also, it was using way less GPU and Battery. enter image description here

My question is why does this? Is it because of their programming language?

  • Are you comparing a whole IDE to a small clock app? – Tulains Córdova Aug 23 '20 at 10:17
  • @TulainsCórdova I don't mean the IDE. i mean Java(TM)....... – Omid.N Aug 23 '20 at 10:21
  • How much is the difference if you change your "Stopwatch" app to also only show the time as a string of digits (so, without the clock face and the moving hands)? – Bart van Ingen Schenau Aug 23 '20 at 10:25
  • @BartvanIngenSchenau I don't think it can explain why it uses 90MB more. also, the clock app has other tabs – Omid.N Aug 23 '20 at 10:29
  • 2
    15MB is lightweight now. Man I'm getting old. – candied_orange Aug 24 '20 at 6:01

It is not the language but it may have something to do with the platform (Java, .NET, native compiler, scripting engine).

From what you provide it is hard to tell. Are you running the program in the debugger? Try running the release version on its own. Then look for images and how they are used. They could be all pre-loaded, images are relatively big compared to logic. The screen image may be updated more often than needed, look for threads in the source code to find out. Finally, a managed code programming environment like Java will use some kind of runtime that optimizes thing in the background. It may reserve an awful lot of memory just because it is there. This even the programmer of the application has little control over. Even 15 MB seems a lot for an alarm/clock application by the way.

  • Actually, I am willing to bet that it is because of the OP's benchmarking methodology. Unfortunately, the OP does not provide much of their methodology, nor any information about their statistical methodology. Any benchmark that does not disclose its methodology nor its statistical analysis is highly suspect in my opinion. – Jörg W Mittag Aug 23 '20 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.