Select to view content in your preferred language

Apparent 1.5 MB Memory Limit

990
3
11-11-2010 10:52 AM
by Anonymous User
Not applicable
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...

Stonewall
0 Kudos
3 Replies
by Anonymous User
Not applicable
Original User: agray1

Stonewall,

ArcGIS is a 32bit application so it doesn't matter if you have 7GB or RAM, it will not use it.  1.5 is a realistic upper limit.  There are some articles on ways to push that up but I don't think they work with arcobjects...  I suggest you process your raster in small pixel blocks.

http://stackoverflow.com/questions/570589/can-a-32bit-process-access-more-memory-on-a-64bit-windows-...
0 Kudos
AlexanderGray
Honored Contributor
More info on this.  Apparently ArcGIS 10 can use more memory but it is still 32 bit.

http://events.esri.com/uc/QandA/index.cfm?fuseaction=answer&conferenceId=2F6DC1A1-1422-2418-883C3868...

Even if ArcGIS desktop was 64bit and you had 192GB RAM, sooner or later someone is bound to feed in a raster that the system can't handle (i.e. TB images.)
0 Kudos
by Anonymous User
Not applicable
Original User: stonewall

Thanks for the responses... I did find the articles and the limiting factor does appear to be the addressing limit of the 32 bit address space.  I did get it working by using PixelBlockCursor.
0 Kudos