does not have enough free memory (RAM+swap)

  • xueming

    I have tried to extract some variables by nco-4.0.6 (nco-4.0.6.win32.cygwin.gz) from cygwin. My PC has 8G memory, and  688055808 bytes= 688055808/1024/1024/1024=0.64GB, but I still get some error message as follow. (The size of file is 222.2GB, the size of file will be about 7GB)

    $ ncks -a -d ocean_time,358,365
    ncks: ERROR nco_malloc() unable to allocate 688055808 bytes
    ncks: INFO NCO has reported a malloc() failure. malloc() failures usually indicate that your machine does not have enough free memory (RAM+swap) to perform the requested operation. As such, malloc() failures result from the physical limitations imposed by your hardware. Read for a description of NCO memory usage. There are two workarounds in this scenario. One is to process your data in smaller chunks. The other is to use a machine with more free memory.

    Aborted (core dumped)

  • Charlie Zender
    Charlie Zender

    Your machine has 8 GB RAM. It does not follow that an 0.64 GB request for contiguous RAM, i.e., a malloc(), will succeed. In your case it fails. Unfortunate, yes. Try closing all unnecessary programs first. Not easy with Windows. The error message explains your other options.