* fixing heap_chunk_in_mb to 512MB doesn't work
@ 2002-09-06 6:18 Charles Werner
0 siblings, 0 replies; 3+ messages in thread
From: Charles Werner @ 2002-09-06 6:18 UTC (permalink / raw)
To: cygwin
Re: Cygwin memory limit
Recently I wanted to increase the program/data memory limit for cygwin
beyond the default 256 MB
and a quick scan of the cygwin list revealed this thread. I was able to
get this to work by doing the
following:
1. modify the registry, adding a DWORD value heap_chunk_in_mb and
setting it to 1024
using the regtool that is part of the cygtools package in cygwin. The
value here is in decimal Mbytes:
regtool -i set /HKCU/Software/Cygnus\
Solutions/Cygwin/heap_chunk_in_mb 1024
regtool -v list /HKCU/Software/Cygnus\ Solutions/Cygwin
2. rebooting the machine
3. turning off the inetd service (if you have installed the cygwin inetd
service)
4. restarting the inetd service
5. open a cygwin bash shell window.
I tested the memory allocation using the following little C program,
compiled with:
gcc -O max_mem.c -o max_mem.exe
#include "stdlib.h"
#include "stdio.h"
int main(int argc, char **argv)
{
char *m;
int mb;
size_t n;
if(argc < 2) {
printf("usage: %s <Mb>\n\n",argv[0]) ;
printf("input parameters: \n");
printf(" MB number of MB of memory to allocate\n");
exit(-1);
}
sscanf(argv[1],"%d",&n);
m = malloc((size_t)n*1024*1024);
if(m == NULL){fprintf(stderr,"cannot allocate memory %d MB of
memory\n",n); exit(-1);}
else printf("allocated %d MB of memory\n",n);
free(m);
return(0);
}
My system is an NT4 SP5 machine running the latest cygwin dll version
1.3.12. I also tried this on a win2K SP2 system
sucessfully.
Cheers,
Charles
--
Dr. Charles L. Werner
Gamma Remote Sensing AG
Thunstrasse 130
CH-3074 Muri b. Bern, Switzerland
http://www.gamma-rs.ch
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: fixing heap_chunk_in_mb to 512MB doesn't work
2002-09-04 2:57 Christophe Trophime
@ 2002-09-04 3:12 ` Dylan Cuthbert
0 siblings, 0 replies; 3+ messages in thread
From: Dylan Cuthbert @ 2002-09-04 3:12 UTC (permalink / raw)
To: cygwin
Hello, can't help you but I had the same problem. Sometimes Cygwin's
configuration sits in different parts of the registry, have a look in
LOCAL_MACHINE\Software\..etc..
If you have any luck, let me know, I just had to give up for the time-being.
Regards
---------------------------------
Q-Games, Dylan Cuthbert.
http://www.q-games.com
P2P internet radio - http://www.peercast.org
"Christophe Trophime" <trophime@grenoble.cnrs.fr> wrote in message
news:1031133455.17672.11.camel@SNCI-PC3-15.grenoble.cnrs.fr...
> As far as I have understood allocation is limited to 128 MB
> in cygwin 1.3.12 but one can increased this limit by setting
> heap_chunk_in_mb registry key.
>
> I tried to fix this value to 512 Mb using :
> regtool set '\user\Software\Cygnus Solutions\Cygwin\heap_chunk_in_mb'
> 512
>
> But when I compile this little test program it fails (Aborted (cored
> dumped)):
>
> #include <iostream>
> using namespace std;
>
> int main(){
>
> char * tab_ptr = new char [256 * 1024 * 1024];
> if ( !tab_ptr ) {
> cerr << "Malloc failed\n";
> exit(1);
> }
> delete tab_ptr;
> return 0;
> }
>
> Thanks for your help
>
>
> --
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting: http://cygwin.com/bugs.html
> Documentation: http://cygwin.com/docs.html
> FAQ: http://cygwin.com/faq/
>
>
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 3+ messages in thread
* fixing heap_chunk_in_mb to 512MB doesn't work
@ 2002-09-04 2:57 Christophe Trophime
2002-09-04 3:12 ` Dylan Cuthbert
0 siblings, 1 reply; 3+ messages in thread
From: Christophe Trophime @ 2002-09-04 2:57 UTC (permalink / raw)
To: cygwin
As far as I have understood allocation is limited to 128 MB
in cygwin 1.3.12 but one can increased this limit by setting
heap_chunk_in_mb registry key.
I tried to fix this value to 512 Mb using :
regtool set '\user\Software\Cygnus Solutions\Cygwin\heap_chunk_in_mb'
512
But when I compile this little test program it fails (Aborted (cored
dumped)):
#include <iostream>
using namespace std;
int main(){
char * tab_ptr = new char [256 * 1024 * 1024];
if ( !tab_ptr ) {
cerr << "Malloc failed\n";
exit(1);
}
delete tab_ptr;
return 0;
}
Thanks for your help
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-09-06 13:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-06 6:18 fixing heap_chunk_in_mb to 512MB doesn't work Charles Werner
-- strict thread matches above, loose matches on Subject: below --
2002-09-04 2:57 Christophe Trophime
2002-09-04 3:12 ` Dylan Cuthbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).