Is it a Cygwin limitaion ?



Purpose of this link to find/list the method to increase the Virtual memory in cygwin.

Cygwin is handling VM as file system, If host machine allow me to create 4GB file than I should get minimum 4GB VM.

I am not able get this :( I tried a lot and finally I stopped working on that, bec it is impossible :)

I will explain the requirement:

I am running a server on cygwin (on windows 7 , 64 bit , 6 GB RAM ), it used to run fine with Linux environment. Aim of the server is supporting the data access protocol.

When client request for the huge data around one GB from the server it start crashing on cygwin (fine with the linux/windows)
On debugging I found that it is failing at huge memory allocation :
_buf = new char[array_wid]
where array_wid is 1GB. So it is finding difficult to get huge continues memory in cygwin.

In cygwin uses the cygwin1.dll to allocate the memory. Default memory allocation is 384MB. To get the max memory you have set registry entry.

I did that using regtool command,
regtool -i set /HKLM/Software/Cygwin/heap_chunk_in_mb 4096
regtool -i set /HKCU/Software/Cygwin/heap_chunk_in_mb 4096

After this command I am started getting 2GB virtual memory

For more information: http://www.cygwin.com/cygwin-ug-net/setup-maxmem.html

To increase the heap memory I rebuild my solution with
-Wl,--stack,8388608,--large-address-aware,--heap,200000000
.

Still I was getting 2GB VM , I am not able to change that using ulimit –v also

And some link talking about the changing the host machine boot.ini file for extra VM, I tried that as well.

And I am sure that with 32-bit cygwin, I cant achieve this , if any one have 64bit cygwin please share :)

1 comment:

Anonymous said...

Good dispatch and this fill someone in on helped me alot in my college assignement. Say thank you you for your information.