Results 1 to 6 of 6

Thread: memory error - java

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    10
    Thanks
    0
    Thanked
    0 times in 0 posts

    memory error - java

    Hey

    Having a problem in java (once again). I keep getting a
    Code:
    java.lang.outofmemoryerror java heap space
    when trying to force a program to accept very large integers...I know how I can fix this from in the command line, but how can I fix it in the source code?

  2. #2
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    Re: memory error - java

    Use a type bigger than int? How big is a 'very large integer'?
    To err is human. To really foul things up ... you need a computer.

  3. #3
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: memory error - java

    one of the fun things about java is which heap do they mean!

    You need to profile it, and figure out what is causing the run away memory allocation. What is it the app is actually doing that is causing so much memory allocation? Is it just using a large chunk of memory on the heap, which runs out?
    throw new ArgumentException (String, String, Exception)

  4. #4
    Senior Member
    Join Date
    Jun 2006
    Posts
    340
    Thanks
    22
    Thanked
    14 times in 14 posts

    Re: memory error - java

    If you turn on heap dump on OutOfMemory, then you can analyse the heap with YourKit or SAP Memory Analyzer. Even if it's not immediately obvious exactly where the problem lies (although with any luck it will be), it will probably narrow down where to look.

  5. #5
    Registered User
    Join Date
    Mar 2009
    Posts
    10
    Thanks
    0
    Thanked
    0 times in 0 posts

    Re: memory error - java

    Thanks for you help guys

  6. #6
    Senior Member Peter Parker's Avatar
    Join Date
    Jan 2008
    Location
    London
    Posts
    348
    Thanks
    98
    Thanked
    62 times in 47 posts
    • Peter Parker's system
      • Motherboard:
      • ASUS Z170 Pro Gaming
      • CPU:
      • i5-6600K
      • Memory:
      • 16GB DDR4
      • Storage:
      • Kingston 128GB SSD + 2x3TB
      • Graphics card(s):
      • GTX970
      • PSU:
      • SilverStone ST50EF
      • Case:
      • Silverstone Grandia GD01S-MXR
      • Operating System:
      • Fedora 33

    Re: memory error - java

    Q: Did you actually fix your problem?

    Sounds like you know how to use -Xmx to give your JVM more memory. Is this all you needed, or did you have an actual coding issue or reference/memory leak? I've seen 2-3 of these in projects in the past and they've been a mix of programming errors and 3rd party bugs (JDBC drivers). I'm always keen to learn more about similar problems.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Which companies are the first tier manufacturers of computer memory?
    By Kerandran in forum PC Hardware and Components
    Replies: 12
    Last Post: 21-10-2008, 08:11 PM
  2. Memory bandwidth tests... any real differences (PC4300 vs. PC7100)
    By graysky in forum PC Hardware and Components
    Replies: 0
    Last Post: 30-10-2007, 10:18 PM
  3. Abit IP35 memory config..
    By daveasp in forum PC Hardware and Components
    Replies: 8
    Last Post: 25-10-2007, 07:18 PM
  4. DDR2 Memory Failure Rate?
    By Thor in forum PC Hardware and Components
    Replies: 31
    Last Post: 18-10-2007, 09:11 PM
  5. Overclocking A64s?
    By Prodigy in forum PC Hardware and Components
    Replies: 4
    Last Post: 09-09-2004, 03:42 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
  •