Hi there,
I'm currently pulling raster imagery from my api and displaying it on my Leaflet map with Shiny. For small areas of imagery this works fine but I've just run into this where for a larger area, for a image of 134.5 MB, R bombs out trying to allocate a vector of 1.0 GB?!
The box it's running on is a t2.large instance so it has 8 GB of RAM to use. It's running on a Debian distro.
trying URL 'http://myawsbox/flood_mapping?location={"type":"Feature","properties":{"_leaflet_id":99,"feature_type":"rectangle"},"geometry":{"type":"Polygon","coordinates":[[[30.2261353,50.5867244],[30.2261353,51.2206474],[30.6738281,51.2206474],[30.6738281,50.5867244],[30.2261353,50.5867244]]]}}'
Content type 'image/tiff' length 141033914 bytes (134.5 MB)
==================================================
Warning: Error in : cannot allocate vector of size 1.0 Gb
Stack trace (innermost first):
79: data.frame
78: .bilinearValue
77: .xyValues
76: raster::projectRaster
75: projectRasterForLeaflet
74: addRasterImage
73: function_list[[i]]
72: freduce
71: _fseq
70: eval
69: eval
68: withVisible
67: %>%
66: getFloodMappingAndDisplayBB
65: observeEventHandler [/srv/shiny-server/testFrontend/server.R#111]
1: runApp
Execution halted
Warning message:
system call failed: Cannot allocate memory
Any ideas how I can prevent this? It's shouldn't be running out of memory...
Many thanks