This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

java.lang.OutOfMemory error  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using an applet that containn a panel that displays a template image and a slider for generating patterns on the image. there are supposed to be 5 transitions. however when i tr and view it i get a run time error telling me that i am out of memory. the image sizes are all approx 300k each. i have used this program using different more memory intensive images and it works. i am totally confused. any help on this would be greatly appreciated.
tom
 
Sheriff
Posts: 9087
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frequently OutOfMemoryErrors are caused by creating too many objects. Are you creating Slide and Template objects in a loop, for example?
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey sorry i didnt get back sooner. i still cant figure it out. i am only creating five image objects. and as isaid already i have had this program working with other images of higher memory. as the images change there is a call to repaint method. ideally i would have to have 20 or more image objects but this is just a prototype. perhaps its to do with heap sizes??? Also each image was originally about 1MB before i exported them down to about 300KB. could this be part of the problem? i am really confused. any help would be very much appreciated.
 
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A 300K jpeg or gif can be many, many times that size when it's held in memory in uncompressed form. If you have access to a profiler, use that to take a look, otherwise run Java with the profiling flags (-Xhprof and friends).

- Peter
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!