Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Creating a Simulator

  1. #1
    Member
    Join Date
    Jun 2011
    Location
    Rhode Island
    Posts
    69
    My Mood
    Bored
    Thanks
    11
    Thanked 7 Times in 6 Posts

    Default Creating a Simulator

    Hi All,

    This is more in java Theory for java programming, my Question regards to a simulator that i have build now I have to create some way to operate it independently. I already have user inputs, database calls for necessary data (4 different db's). I need to continue with rmi, and messaging UDP protocols. However they(management) threw a damper in my thoughts progress and current running STIM sim (3rd time I reprogrammed it from add on after the fact). They want it to run independent with other simulators (that get users or not) on a timed messaging system. I hope your following me still.



    Pen to paper.
    create a list of objects that can contain up to 12 hours of data sets. aprox. 3600-20000 objects per hour
    I am thinking memory over flow...
    hold multiple list to re-use
    gui interface to create this list. (my main problem is starting here, or lack of thought)

    I can create a new db(database) to hold all the list and not really much of a problem.

    I can use the database to help create the 12 hour list. however, where does the heap overflow come in to play. (out of memory).

    the list needs to be editable throughout. (this is my kicker, how without overflow memory)

    any thoughts on the matter... thanks in advance.

    current thoughts
    use the database to hold the list and then write to the db every 100 data sets that are created, this way i don't hold a huge list and I can kick off a thread to run the write to db.

    editable per 100, call to the db to get new list on review.


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,156
    My Mood
    Hungover
    Thanks
    141
    Thanked 595 Times in 510 Posts

    Default Re: Creating a Simulator

    Sorry but... what's your question? We can't really predict what's going to happen on your system, so it's hard to give you any real guidance. Are you looking for help designing the GUI? In dealing with an OutOfMemoryError? Either way, it's still hard to answer general questions like that.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Member
    Join Date
    Jun 2011
    Location
    Rhode Island
    Posts
    69
    My Mood
    Bored
    Thanks
    11
    Thanked 7 Times in 6 Posts

    Default Re: Creating a Simulator

    the question is more on the out of memory, while creating this list of data. If you base it on my system, its not true it should be on any system machine (weakest link).

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,156
    My Mood
    Hungover
    Thanks
    141
    Thanked 595 Times in 510 Posts

    Default Re: Creating a Simulator

    Well, there are a few ways around it:

    First off, are you sure you have to have all of those Objects in memory? Can't you load a subset at a time?
    Can you write to file or to a database at all?
    Does increasing the memory available to the JVM help at all?

    Mostly, the first question is probably where you should be focusing. I guess that's what your "current thoughts" are, so I'd have a go at that and see what happens.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. The Following User Says Thank You to KevinWorkman For This Useful Post:

    william (June 16th, 2011)

  6. #5
    Member
    Join Date
    Jun 2011
    Location
    Rhode Island
    Posts
    69
    My Mood
    Bored
    Thanks
    11
    Thanked 7 Times in 6 Posts

    Default Re: Creating a Simulator

    Quote Originally Posted by KevinWorkman View Post

    First off, are you sure you have to have all of those Objects in memory? Can't you load a subset at a time?
    I need 15 minutes of data at any given time, once it is running. Users will determine while in creation mode. I could limit it but not sure how.

    Quote Originally Posted by KevinWorkman View Post
    Can you write to file or to a database at all?
    yes I have made a Database Manager to manage 4 db's that I use, plus I can create another just for this.
    not so sure about a file, never thought about it. Write to a file and hold the files in a directory, read from a file. I would think this is similar to the Logger in java?

    Quote Originally Posted by KevinWorkman View Post
    Does increasing the memory available to the JVM help at all?
    I will read up more on this.


    Thanks Kevin, Let me do some reading on the JVM, and write a test program for IO read/write.

Similar Threads

  1. [SOLVED] Java Noob: Coin Toss Simulator (no GUI)
    By bgroenks96 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: June 4th, 2011, 10:28 PM
  2. [SOLVED] Creating a .jar that uses a DB
    By mycallsevern in forum JDBC & Databases
    Replies: 2
    Last Post: May 8th, 2011, 10:43 AM
  3. Rule base for graphical editor / simulator
    By Alice in forum Java Theory & Questions
    Replies: 2
    Last Post: December 18th, 2010, 09:38 AM
  4. creating a gui
    By rsala004 in forum AWT / Java Swing
    Replies: 2
    Last Post: July 21st, 2009, 02:17 AM
  5. JAVA simulator
    By YAS218 in forum Java Theory & Questions
    Replies: 8
    Last Post: July 20th, 2009, 09:57 AM