June 06, 2009 Pop quiz [memory usage] | ||||
|---|---|---|---|---|
| ||||
// Works for DMD1/Phobos, DMD1/Tango and DMD2/Phobos
version(Tango) import tango.io.Console;
else import std.stdio;
struct S
{
ubyte[40_000] data;
}
void main()
{
S[] a;
a ~= S();
// QUESTION: How much memory will this program consume upon reaching this point?
version(Tango) Cin.copyln();
else readln();
}
| ||||
June 06, 2009 Re: Pop quiz [memory usage] | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | Vladimir Panteleev:
> // QUESTION: How much memory will this program consume upon reaching this
> point?
There's some serious bug here. It allocates 40+ MB.
The following code even crashes LDC during the compilation, I'll ask in the LDC channel:
struct S { ubyte[40_000] d; }
void main() {
S[] a;
a ~= S();
}
Bye and thank you for the little test,
bearophile
| |||
June 06, 2009 Re: Pop quiz [memory usage] | ||||
|---|---|---|---|---|
| ||||
Posted in reply to bearophile | > The following code even crashes LDC during the compilation, I'll ask in the LDC channel:< The good ChristianK has already added it: http://www.dsource.org/projects/ldc/ticket/320 Bye, bearophile | |||
June 06, 2009 Re: Pop quiz [memory usage] | ||||
|---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Sat, 06 Jun 2009 16:17:10 +0300, bearophile <bearophileHUGS@lycos.com> wrote: > There's some serious bug here. It allocates 40+ MB. Um, it should be much more than that. What are you running? -- Best regards, Vladimir mailto:thecybershadow@gmail.com | |||
June 06, 2009 Re: Pop quiz [memory usage] | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | Vladimir Panteleev:
>Um, it should be much more than that. What are you running?<
I am running DMD v1.042 with Phobos on WinXP, the compilation needs only tents of a second, and at runtime it allocated 48.3 MB.
DMD v2.030 with Phobos needs 49.028 MB and the compilation is a bit slower, 0.35 seconds.
Bye,
bearophile
| |||
June 06, 2009 Re: Pop quiz [memory usage] | ||||
|---|---|---|---|---|
| ||||
Posted in reply to bearophile | On Sat, 06 Jun 2009 17:11:45 +0300, bearophile <bearophileHUGS@lycos.com> wrote: > Vladimir Panteleev: >> Um, it should be much more than that. What are you running?< > > I am running DMD v1.042 with Phobos on WinXP, the compilation needs only tents of a second, and at runtime it allocated 48.3 MB. > > DMD v2.030 with Phobos needs 49.028 MB and the compilation is a bit slower, 0.35 seconds. Ah, that's just the working set. Have a look at the virtual memory usage. -- Best regards, Vladimir mailto:thecybershadow@gmail.com | |||
June 06, 2009 Re: Pop quiz [memory usage] | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | On Sat, Jun 6, 2009 at 10:19 AM, Vladimir Panteleev<thecybershadow@gmail.com> wrote: > On Sat, 06 Jun 2009 17:11:45 +0300, bearophile <bearophileHUGS@lycos.com> wrote: > >> Vladimir Panteleev: >>> >>> Um, it should be much more than that. What are you running?< >> >> I am running DMD v1.042 with Phobos on WinXP, the compilation needs only tents of a second, and at runtime it allocated 48.3 MB. >> >> DMD v2.030 with Phobos needs 49.028 MB and the compilation is a bit slower, 0.35 seconds. > > Ah, that's just the working set. Have a look at the virtual memory usage. > > -- > Best regards, > Vladimir mailto:thecybershadow@gmail.com > 1.5GB. Wow. | |||
June 06, 2009 Re: Pop quiz [memory usage] | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | Vladimir Panteleev:
> Ah, that's just the working set. Have a look at the virtual memory usage.<
How can I tell them apart? How can I measure that ' virtual memory usage' on Windows?
Bye,
bearophile
| |||
June 06, 2009 Re: Pop quiz [memory usage] | ||||
|---|---|---|---|---|
| ||||
Posted in reply to bearophile | Hello bearophile,
> Vladimir Panteleev:
>
>> Ah, that's just the working set. Have a look at the virtual memory
>> usage.<
>>
> How can I tell them apart? How can I measure that ' virtual memory
> usage' on Windows?
>
> Bye,
> bearophile
bring up task manager
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply