AnsweredAssumed Answered

Apparent 1.5 MB Memory Limit

Question asked by geonetadmin on Nov 11, 2010
Latest reply on Nov 19, 2010 by geonetadmin
Original User: stonewall

I'm running ArcGIS 9.3.1 on a Windows 7 Pro machine with an Intel i7 and 12 GB of RAM.  I've written a VB.NET arcObjects program using Microsoft Visual Studio 2007.  The program opens a series of single band rasters (floating point, 3856 x 3227). And creates two new rasters with the same properties.  The number of input rasters varies from 4 to 8.  The program runs fine when I limit the number of input rasters to 5 or fewer.  When I set the input to open 6 input rasters and produce two output rasters I get an error on the statement that creates the raw pixels for the second output raster... code snippet follows:

                For i = 0 To 1  
                    pixelBlockOrigin(i) = New Pnt
                    pixelBlockOrigin(i).SetCoords(0, 0)
                    rawPixels(i) = Nothing
                    pixelBlockSize(i) = New DblPntClass
                    pixelBlock3(i) = Nothing
                    pxlCursor(i) = Nothing
                    pxlCursor(i) = New PixelBlockCursor
                Next i

                ' QI for IRawPixels and IRasterProps
                For i = 0 To 1
                    rasterBandCollection(i) = CType(newDataset(i), IRasterBandCollection) ' Phase VII
                    rawPixels(i) = CType(rasterBandCollection(i).Item(0), IRawPixels)
                    rasterProps(i) = CType(rawPixels(i), IRasterProps)
                    pixelBlockSize(i).SetCoords(rasterProps(i).Width, rasterProps(i).Height)
                    pixelBlock3(i) = CType(rawPixels(i).CreatePixelBlock(pixelBlockSize(i)), IPixelBlock3)
                    pixelData(i) = CType(pixelBlock3(i).PixelDataByRef(0), System.Array)
                Next i

In looking at the Windows Resource Monitor the 8th raster would put the total memory required by my VB.NET program over 1.5 GB.  (There is still more than 6.0 GB of unused memory available).  Is there some limitation that I have not been able to find that set a 1.5 GB boundary for a 9.3 ArcObjects program?  By the way I tried using IPixelBlockCursor to cut up the amount of memory usage but had other troubles making that work and couldn't find a VB.NET sample that helped... Any help would be appreciated...