Menu

MarsProject_3.05 is eating the processor

Help
Joop
2016-06-12
2016-06-18
  • Joop

    Joop - 2016-06-12

    First, I'm running OS/2-eComStation and we have OpenJDK 1.6 aka Java 6 based on Build 27. I'm still on one precessor core. Starting the program was an experience, never seen it this way. I have difficulty to get around. Setting the clock on "hold" or "pause" will drop the processor to more normal readings of a few procent. Setting the clock "on", the processor shoots to 90-95%. Is this an incompatibility between Java's, some bug? Might be our implementation of Java, might be some part of the program. But it runs.
    Are MarsProject_3.06 and 3.07 really for Java 7 and up? Saw same signature in version 3.05 and this version runs in Java 6.
    Regards,
    Joop

     

    Last edit: Joop 2016-06-12
  • manny kung

    manny kung - 2016-06-13

    Hi Joop,

    Sorry that 3.05 doesn't work on your computer due to mars-sim's high cpu utilization. We are following the tradition in mars-sim to develop deep simulation model of reality than what you would find in typical games today in the market. As a result, we may not have optimized our codes to run well on a single core or dual core. Meanwhile, we're trying to improve our documentation.

    In 3.07, we adopted newer concurrency coding practice and enabled better use of multi-threading/multi-core. The downside is that a single core cpu will have a hard time handling all those threads.

    Besides security bug fixes and enhancement, newer version of java such as Java 8 makes running application smoother and better. why not upgrading it?

    I haven't used OpenJDK but I'll set up OpenJDK 8 in ubuntu and test it tomorrow on 3.07 and on the latest build.

    Let me know if you can run 3.07.

    Manny

     
  • manny kung

    manny kung - 2016-06-13

    To break down your question further regarding the java version,

    in version 3.07 README, we specify java 7 or higher but we could have said java 5 or 6.

    What we did was implementing the use of ThreadPoolExecutor / ExecutorService from java.util.concurrent for handling threads in 3.07.

    It was Java 5 when they first introduced java.util.concurrent and added ExecutorService class.

    So, you should be safe to run 3.07 on even java 5 or 6 since in 3.07 we didn't really use any new class or features introduced in java 7.

    However, I do strongly recommend running it on a dual core cpu at the minimum.

    Another important thing is the amount of RAM.

    Question: how much memory do you have on that computer with one CPU core?

    I can run 3.07 (or even pre-release 3.08 build inside Eclipse IDE) on my slow tablet (Dell Venue 8 Pro) with Atom Z3740D and 2 GB.

    In the next release 3.08, we will specify java 8 as the minimum as we are gradually replacing Swing components with JavaFX nodes and are also adopting the use of Stream and Lambda Expression.

    At the same time, we will add in more flexibility in how mars-sim will run in this upcoming release.

    For example, mars-sim will be able to run in (1) headless mode or (2) GUI mode.

    Also, users will be able to choose the maximum amount of memory that mars-sim is allowed to use (512MB, 768 MB, 1 GB, 1.5 GB or 2 GB, etc.)

    So users may run mars-sim as sort of a background task (headless, without graphical UI) in a terminal or a command line for hours. It will autosave the progress every 10 or 15 minutes based on the your xml file config setting.

    Thanks for raising these questions and appreciate your enthusiasm.

     

    Last edit: manny kung 2016-06-13
  • Joop

    Joop - 2016-06-14

    Hi Manny,

    Thanks for your answers.
    No, can't run 3.07, its build with Build-Jdk: 1.7.0_65.
    Dual or more core systems, supported by OS/2, but that means a new computer.

    Java is free available for all the major systems, Windows, Apple and Linux. We have to fund for a Java, so its not free to our community. A Java 8 is in the planning, but I'm not sure when its ready. Also we have OpenJDK because others are not free to compile a new version.
    I have 1G physical, but I use very seldom this amount, most of the times usage stuck somewhere between 300Mb and 400Mb. Memory is not an issue with the program.

    If I may pass some thoughts. After starting the mars-sim-main-x.xx.jar it start itself again with in the program fixed settings. It would be nice if you can do this the Java way so you can redirect the ".mars-sim" directory in the home directory to another place. Everything in the home directory is a sick idea of Microsoft. I usually place this directory in the same directory as the program. Works perfect.

    To set something strait, version 3.05 does work on my computer, only some things are going slow. Setting clock to hold its no problem.

     
  • manny kung

    manny kung - 2016-06-18

    There's quite a bit of improvement, bug fixes new features we've made since 3.05.

    So I'll need to take a closer look at 3.05 codebase to tell why it's going slow.

    Specifically I'll see if I can update Simulation.java and MasterClock.java with better handling of threads without breaking other things.

    After starting the mars-sim-main-x.xx.jar it start itself again with in the program fixed settings. It would be nice if you can do this the Java way so you can redirect the ".mars-sim" directory in the home directory to another place.

    Do you mean the default location where mars-sim save its default.sim ?

    I have no idea how under OS/2 what the home directory will be.

    Perhaps the best is to let user to pre-configure where the home directory is in the Main Menu as a new feature in future releases.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.