www.digitalmars.com         C & C++   DMDScript  

D.gnu - cc1d: out of memory allocating 4072 bytes after a total of 199581696 bytes

reply bug d.com writes:
when compile a large file (10K generated-lines), although the system has ~ 650M
memory.

$ free
total       used       free     shared    buffers     cached
Mem:        905732     216912     688820          0       7996     116968
-/+ buffers/cache:      91948     813784
Swap:      1050800          0    1050800

$ make test.o
dmd -version=DEBUG -g -debug  -oftest.o -c test.d

cc1d: out of memory allocating 4072 bytes after a total of 199581696 bytes
make: *** [test.o] Error 1

$ free
total       used       free     shared    buffers     cached
Mem:        905732     216976     688756          0       8128     116968
-/+ buffers/cache:      91880     813852
Swap:      1050800          0    1050800
Apr 02 2005
parent reply bug d.com writes:
The text allgnment is wrong in the original message, it should be:

$ free
             total       used       free     shared    buffers     cached
Mem:        905732     216912     688820          0       7996     116968
-/+ buffers/cache:      91948     813784
Swap:      1050800          0    1050800

i.e.: the free mem = 688820 K, before and after the compilation. In article <d2ncbm$1aa1$1 digitaldaemon.com>, bug d.com says...
when compile a large file (10K generated-lines), although the system has ~ 650M
memory.

$ free
             total       used       free     shared    buffers     cached
Mem:        905732     216912     688820          0       7996     116968
-/+ buffers/cache:      91948     813784
Swap:      1050800          0    1050800

$ make test.o
dmd -version=DEBUG -g -debug  -oftest.o -c test.d

cc1d: out of memory allocating 4072 bytes after a total of 199581696 bytes
make: *** [test.o] Error 1

$ free
             total       used       free     shared    buffers     cached
Mem:        905732     216976     688756          0       8128     116968
-/+ buffers/cache:      91880     813852
Swap:      1050800          0    1050800

Apr 02 2005
parent reply =?ISO-8859-1?Q?Thomas_K=FChne?= <thomas-dloop kuehne.THISISSPAM.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

| In article <d2ncbm$1aa1$1 digitaldaemon.com>, bug d.com says...
|
|> when compile a large file (10K generated-lines), although the system
|> has ~ 650M memory.
<snip>

What about the memory usage during the compilation? Try eg "top" with an
~ update frequency of 1 second.

Do you use templates in your code?
On what system are you running?
Could you repeat that compilation with DMD 0.119?
What happens if you remove the "-g -debug" flags?

Thomas

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFCT4AD3w+/yD4P9tIRAghWAKCgvDmNl5vaVckYOqeMcxZmaagTvwCg05Sv
rABGFfXxal0BZlNj+WDxqEU=
=OWjE
-----END PGP SIGNATURE-----
Apr 02 2005
parent reply bug d.com writes:
What about the memory usage during the compilation? Try eg "top" with an
~ update frequency of 1 second.

$ top -d 0.5 The memory used by cc1d continous grows to ~ 250M.
Do you use templates in your code?

Yes.
On what system are you running?

$ uname -a Linux 2.6.11-gentoo-r4 #2 SMP Fri Apr 1 22:43:54 GMT 2005 i686 Intel(R) Pentium(R) 4 CPU 2.60GHz GenuineIntel GNU/Linux
Could you repeat that compilation with DMD 0.119?

No problem with DMD 119: dmd uses about 210M memory.
What happens if you remove the "-g -debug" flags?

No difference. DMD 119 always succeeds; and gdc fails (after about 250M shown in top): virtual memory exhausted: Cannot allocate memory
Apr 02 2005
parent reply =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

bug d.com wrote:
|> What about the memory usage during the compilation? Try eg "top" with
|> an ~ update frequency of 1 second.
|
|
| $ top -d 0.5
|
| The memory used by cc1d continous grows to ~ 250M.
|
|
|>Do you use templates in your code?
|
|
| Yes.
|
|
|>On what system are you running?
|
|
| $ uname -a
| Linux 2.6.11-gentoo-r4 #2 SMP Fri Apr 1 22:43:54 GMT 2005 i686
| Intel(R) Pentium(R) 4 CPU 2.60GHz GenuineIntel GNU/Linux
|
|
|>Could you repeat that compilation with DMD 0.119?
|
|
| No problem with DMD 119: dmd uses about 210M memory.
|
|
|>What happens if you remove the "-g -debug" flags?
|
|
| No difference.  DMD 119 always succeeds; and gdc fails (after about
250M shown
| in top):
|
| virtual memory exhausted: Cannot allocate memory

Let's see if this is a GDC specific frontend bug. Can you repeat that
test with DMD 0.110 (ftp://ftp.digitalmars.com/dmd.110.zip)?
Most of GDC-0.10's frontent is based on the DMD 0.110 code.

If DMD 0.110 doesn't show the same memory problem could you please send
me the generator and/or generated sourcecode via email?
(remove the obvious part of the email address)

Thomas



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFCT5AX3w+/yD4P9tIRAv8oAJ0Zm7n/B4w1DmWy+p/lFhwhTL+u0wCgtyXV
Kj8sLKmvpoJUaDinVNAeha0=
=EXCe
-----END PGP SIGNATURE-----
Apr 02 2005
parent reply bug d.com writes:
Let's see if this is a GDC specific frontend bug. Can you repeat that
test with DMD 0.110 (ftp://ftp.digitalmars.com/dmd.110.zip)?
Most of GDC-0.10's frontent is based on the DMD 0.110 code.

for DMD 110: with -g -debug, Internal error: ../ztc/elfobj.c 1251 without flag, it can run thru.
If DMD 0.110 doesn't show the same memory problem could you please send
me the generator and/or generated sourcecode via email?

My boss may fire me :-(, sorry. I tried gdc on another machine, also with 600M+ free memory when compiling, Linux 2.6.7-gentoo-r11 #1 Fri Sep 17 01:05:07 GMT 2004 i686 Intel(R) Pentium(R) M processor 1700MHz GenuineIntel GNU/Linux with/without '-g -debug' flag, gdc fails with the same message: virtual memory exhausted: Cannot allocate memory This happens after alloc' ~ 250M memory (show from top).
Apr 02 2005
parent =?ISO-8859-1?Q?Thomas_K=FChne?= <thomas-dloop kuehne.THISISSPAM.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

bug d.com wrote:
|> If DMD 0.110 doesn't show the same memory problem could you
|> please send me the generator and/or generated sourcecode
|> via email?
|
|
| My boss may fire me :-(, sorry.

I'm not interrested in you actual code *g* but on the kind(templates
inside of templates, lot's of static arrays, whatever) of code used.

Could you please write an IP free sample, e.g. something like
http://dstress.kuehne.cn/run/many_functions_01.d ?

| I tried gdc on another machine, also with 600M+ free memory when
| compiling,
|
| Linux 2.6.7-gentoo-r11 #1 Fri Sep 17 01:05:07 GMT 2004 i686 Intel(R)
| Pentium(R) M processor 1700MHz GenuineIntel GNU/Linux
|
| with/without '-g -debug' flag, gdc fails with the same message:
|
| virtual memory exhausted: Cannot allocate memory
|
| This happens after alloc' ~ 250M memory (show from top).

Can you increase the size of your sample a bit, so that DMD 0.119
crosses the 250M border?

What happens if you run gdc with the "-c" flag - just to make sure that
memory leaks into the linking stage aren't the issue.

Thomas

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFCT9ET3w+/yD4P9tIRAl7YAJ41WTDcM+Y98tLHi+ABhF9BwbO0tACdGzD6
vZ0PsjVFB1uLily+uxVWw+Y=
=lTta
-----END PGP SIGNATURE-----
Apr 03 2005