Opened 16 years ago
Closed 16 years ago
#2937 closed defect (fixed)
Huge memory requirements for image import
| Reported by: | Owned by: | team | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Core | Version: | latest |
| Keywords: | Cc: |
Description
If I use Java with a 1200MB heap and do an image import from a .gpx file the resident memory of the Java process increases massively, eventually using >1GB before the oom-killer kicks in and kills the process. I have about 45 photos of 105MB total. Using josm-r1779.
With a standard heap size I get the error:
java.lang.OutOfMemoryError: Java heap space
at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:41)
at java.awt.image.Raster.createPackedRaster(Raster.java:458)
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1015)
at sun.awt.image.ImageRepresentation.createBufferedImage(ImageRepresentation.java:223)
at sun.awt.image.ImageRepresentation.setPixels(ImageRepresentation.java:475)
at sun.awt.image.ImageDecoder.setPixels(ImageDecoder.java:120)
at sun.awt.image.JPEGImageDecoder.sendPixels(JPEGImageDecoder.java:97)
at sun.awt.image.JPEGImageDecoder.readImage(Native Method)
at sun.awt.image.JPEGImageDecoder.produceImage(JPEGImageDecoder.java:119)
at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:246)
at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
I have 1.5GB memory so Josm should be able to index 105MB of photos. I wonder if they are all being loaded simultaneously rather than being loaded on demand? Or if there is a memory leak somewhere?
Attachments (0)
Change History (2)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
The geoimage code was replaced by the AgPifoJ Plugin. This is no longer an issue.



The photos are high resolution 8 megapixel. Lowering resolution beforehand reduces the problem: mkdir s; for x in *.jpg; do convert $x -resize 1024x768 s/$x; done . Now use the lower resolution directory.