• 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!