Results 1 to 4 of 4
  1. #1
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default Simulate a OutOfMemoryError on eclipse possible?

    Hai.
    Simple question, Can I reduce the temp memory that eclipse use on my script to
    simulate my school computer?
    Because I load images, and get OutOfMemoryError
    so I need to make that happen at home too, how?

    Thanks :D

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,361
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Addez View Post
    Hai.
    Simple question, Can I reduce the temp memory that eclipse use on my script to
    simulate my school computer?
    Because I load images, and get OutOfMemoryError
    so I need to make that happen at home too, how?

    Thanks :D
    Allocate a huge char array in your main method, like this:

    Java Code:
    public static void main(String[] args) {
       char[] dummy= new char[<some huge number>];
       ...
    }
    and set the maximum heap size (-Xmx) to a small number.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Addez is offline Senior Member
    Join Date
    Aug 2009
    Posts
    294
    Rep Power
    0

    Default

    Awsome idea :D
    Done and done!
    It works awsomely :D :D
    Thanks!

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,361
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Addez View Post
    Awsome idea :D
    Done and done!
    It works awsomely :D :D
    Thanks!
    Good; I guess you're one of the few who's happy to see an OutOfMemoryError ;-)

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. How to simulate browser CTRL+F function
    By crisfromnova in forum SWT / JFace
    Replies: 1
    Last Post: 09-14-2010, 02:41 PM
  2. How to simulate mouse/key in a component?
    By crikey in forum Advanced Java
    Replies: 2
    Last Post: 08-09-2010, 04:10 PM
  3. Simulate a Network using Java
    By fung1223 in forum New To Java
    Replies: 0
    Last Post: 01-13-2010, 10:46 AM
  4. Replies: 0
    Last Post: 07-25-2008, 02:26 PM
  5. simulate message box
    By pablitohh in forum New To Java
    Replies: 1
    Last Post: 12-05-2007, 04:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •