D - Out of memory?
- Paul Runde (29/29) Jan 23 2004 I've tried different variations of this:
- J C Calvarese (13/49) Jan 23 2004 I don't think this is a limitation of D. It may be a limitation of
- J Anderson (7/53) Jan 23 2004 With windows XP you can have a huge amount of virtual memory. Simply
- Paul Runde (5/25) Jan 23 2004 Maybe for large collections I should be using class allocators? But it
- yaneurao (7/11) Jan 23 2004 it is a bug I had reported.
- Manfred Nowak (9/12) Jan 24 2004 Cannot rebuild phobos:
- yaneurao (5/8) Jan 24 2004 it needs forward declaration like this:
- Manfred Nowak (5/9) Jan 25 2004 thnx.
- Paul Runde (3/17) Jan 25 2004 That did the trick. Thanks.
- Walter (3/6) Feb 02 2004 I have the fix folded in now. Thanks.
I've tried different variations of this: class foo { int x; int x1; int x2; int x3; } foo[] fooa; int main(char[][] args) { //fooa.length = 245760; while(1) { try fooa ~= new foo(); catch { printf("Allocated %d instances of foo.\n", fooa.length); break; } } return 0; } This one creates 15360 instances of foo whether on a Win95 machine with 128MB or on a WinME with 256MB. I searched the docs and could not find anything. Also, setting the length of the array to anything over 245760 causes an Access Violation error. What am I missing? Thanks.
Jan 23 2004
Paul Runde wrote:I've tried different variations of this: class foo { int x; int x1; int x2; int x3; } foo[] fooa; int main(char[][] args) { //fooa.length = 245760; while(1) { try fooa ~= new foo(); catch { printf("Allocated %d instances of foo.\n", fooa.length); break; } } return 0; } This one creates 15360 instances of foo whether on a Win95 machine with 128MB or on a WinME with 256MB. I searched the docs and could not find anything. Also, setting the length of the array to anything over 245760 causes an Access Violation error. What am I missing? Thanks.I don't think this is a limitation of D. It may be a limitation of Win9X. It probably also depends on the computer's available memory since each computer has a finite amount of RAM (even when you consider paging files). I have 128MB of RAM and I was running several programs at the same time. (I'm running WinXP Home.) This is what I got: Allocated 1411072 instances of foo. And I also got some friendly message boxes popping up telling me I was low on memory. And icons started disappearing. -- Justin http://jcc_7.tripod.com/d/
Jan 23 2004
J C Calvarese wrote:Paul Runde wrote:With windows XP you can have a huge amount of virtual memory. Simply get a second hard rive and make a few GB virtual memory on each drive. I think win95 wasn't (isn't) so flexible in this way. Still virtual memory is slowwwww. -- -Anderson: http://badmama.com.au/~anderson/I've tried different variations of this: class foo { int x; int x1; int x2; int x3; } foo[] fooa; int main(char[][] args) { //fooa.length = 245760; while(1) { try fooa ~= new foo(); catch { printf("Allocated %d instances of foo.\n", fooa.length); break; } } return 0; } This one creates 15360 instances of foo whether on a Win95 machine with 128MB or on a WinME with 256MB. I searched the docs and could not find anything. Also, setting the length of the array to anything over 245760 causes an Access Violation error. What am I missing? Thanks.I don't think this is a limitation of D. It may be a limitation of Win9X. It probably also depends on the computer's available memory since each computer has a finite amount of RAM (even when you consider paging files). I have 128MB of RAM and I was running several programs at the same time. (I'm running WinXP Home.) This is what I got: Allocated 1411072 instances of foo. And I also got some friendly message boxes popping up telling me I was low on memory. And icons started disappearing.
Jan 23 2004
J Anderson wrote:J C Calvarese wrote:Maybe for large collections I should be using class allocators? But it is just odd that two machines with different OS versions and memory amounts would allocate exactly the same number of instances. And I would have expected the results above, but neither machine complained.I don't think this is a limitation of D. It may be a limitation of Win9X. It probably also depends on the computer's available memory since each computer has a finite amount of RAM (even when you consider paging files). I have 128MB of RAM and I was running several programs at the same time. (I'm running WinXP Home.) This is what I got: Allocated 1411072 instances of foo. And I also got some friendly message boxes popping up telling me I was low on memory. And icons started disappearing.With windows XP you can have a huge amount of virtual memory. Simply get a second hard rive and make a few GB virtual memory on each drive. I think win95 wasn't (isn't) so flexible in this way. Still virtual memory is slowwwww.
Jan 23 2004
In article <busj6v$2dl2$1 digitaldaemon.com>, Paul Runde says...This one creates 15360 instances of foo whether on a Win95 machine with 128MB or on a WinME with 256MB. I searched the docs and could not find anything. Also, setting the length of the array to anything over 245760 causes an Access Violation error.it is a bug I had reported. http://www.digitalmars.com/drn-bin/wwwnews?D/22303 and I wrote how to fix it. by rebuilding phobos such as the following article, it'll be fixed. http://www.digitalmars.com/drn-bin/wwwnews?D/21217 yaneurao.
Jan 23 2004
yaneurao schrieb: [...]by rebuilding phobos such as the following article, it'll be fixed. http://www.digitalmars.com/drn-bin/wwwnews?D/21217Cannot rebuild phobos: | std\thread.d(337): undefined identifier GetCurrentProcess Where is the trick? So long. -- Fight Spam! Join EuroCAUCE: http://www.euro.cauce.org/ 2EA56D6D4DC41ABA311615946D3248A1
Jan 24 2004
In article <buv4go$aun$1 digitaldaemon.com>, Manfred Nowak says...Cannot rebuild phobos: | std\thread.d(337): undefined identifier GetCurrentProcess Where is the trick?it needs forward declaration like this: extern(Windows) export void* GetCurrentProcess(); // void* is an alias of HANDLE yaneurao.
Jan 24 2004
yaneurao wrote:it needs forward declaration like this: extern(Windows) export void* GetCurrentProcess(); // void* is an alias of HANDLEthnx. extern(Windows) export thread_hdl GetCurrentProcess(); played the trick. So long.
Jan 25 2004
yaneurao wrote:it is a bug I had reported. http://www.digitalmars.com/drn-bin/wwwnews?D/22303 and I wrote how to fix it. by rebuilding phobos such as the following article, it'll be fixed. http://www.digitalmars.com/drn-bin/wwwnews?D/21217 yaneurao.That did the trick. Thanks. Paul
Jan 25 2004
"yaneurao" <yaneurao_member pathlink.com> wrote in message news:bustsi$2u0b$1 digitaldaemon.com...and I wrote how to fix it. by rebuilding phobos such as the following article, it'll be fixed. http://www.digitalmars.com/drn-bin/wwwnews?D/21217I have the fix folded in now. Thanks.
Feb 02 2004