2
Demolishun
103d

Question for all you Java devs out there (and a story). We have a customer that we interfacing with their machine. They sent us a simulator that runs in Windows written in Java. I did try running it in Linux, but the JVMs I have installed did not like it at all. Complained about missing deprecated stuff. I start up their sim in Windows and find it is opening between 50 and 100 network ports. Then I tell the simulator to run inside the gui for their program. It pegs all of my processor cores at 100%. I have pegged cores in software before, then corrected my errors in my code. However, I have never pegged all the cores at once. I am kind of in shock.

So, how hard is it to peg all the cores in a Java program? I assume they have a thread on every port or some nonsense?

Comments
  • 2
    Even that would cause this. They would also have to so busy waiting instead of using blocking calls.

    You have to do a lot of wrong stuff to make Java peg all your cores, just like any other language
  • 1
    That's what I would hope for if it means that the simulation runs faster
  • 1
    I wanted to make a stupid joke about how verbose Java code is, but then stumbled upon some -verbose option which shows when and possibly how often classes are loading during runtime. Maybe that might help?

    Alternatively, running a profiler?
  • 1
    java -verbose HelloWorld
  • 0
    @Chewbanacas the code is to simulate a real device. We will be talking to the real device soon. I don't really want to troubleshoot their shit code anyway.
  • 2
    @Demolishun understandable
    Fixing other peoples code and getting blamed for making it worse because of obfuscated caveats is the absolute fucking worst
Add Comment