[GRASS-user] ERROR: G_malloc: unable to allocate 2147483648 bytes at main.c:153

Glynn Clements glynn at gclements.plus.com
Mon Mar 22 09:54:49 EDT 2010


Hamish wrote:

> > Hi, i am trying extract road network
> > from a raster map but each time i run the image filter, i
> > get this error message: ERROR: G_malloc: unable to allocate
> > 2147483648 bytes at main.c:153.
> 
> aka it is trying to use >2gig RAM and there is not enough memory.
> Possibly because you are not using a 64bit OS, and possibly because
> you don't actually have that much memory in your computer.
> Maybe try on a smaller dataset?

2147483648 is exactly 2GiB; I'm wondering if that's the actual size
(e.g. 16384 x 16384 x 8bytes/cell) or an uninitialised variable (e.g. 
initialised to INT_MIN in the code and not updated).

On Linux, it is possible to allocate 2GiB on a 32-bit system, provided
that there's a contiguous block (in practice, this means that the
stack size isn't "unlimited"). You don't need that much physical RAM,
only swap (although performance may be unacceptable if you're relying
upon swap; it depends upon the access pattern).

"Desktop" versions of Windows normally only allow 2GiB on 32-bit
systems. Server versions allow up to 3GiB, and the desktop versions
can be tweaked to allow it (but it isn't straightforward).

> > i also connnot use the i.class command on my windows
> > machine which is the platform i am working with.
> 
> you will have to wait for someone to build GRASS 6.4.0RC6 for Cygwin.
> i.class uses UNIX-style Xmonitors which are not available on standard
> MS Windows. (or try GRASS on a Mac or Linux computer/virtual machine)

I'll probably be building RC6 for Cygwin some time today.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list