[phobos] phobos commit, revision 2331

Sean Kelly sean at invisibleduck.org
Fri Jan 14 12:24:06 PST 2011


It could be a difference in the Windows vs. Linux memory manager.  Did anyone ever try hooking the Boehm GC into DMD?

Sent from my iPhone

On Jan 14, 2011, at 11:58 AM, Jonathan M Davis <jmdavisProg at gmx.com> wrote:

> On Friday, January 14, 2011 10:43:26 Brad Roberts wrote:
>> On 1/14/2011 10:39 AM, Robert Jacques wrote:
>>> On Fri, 14 Jan 2011 11:19:34 -0500, Jonathan M Davis <jmdavisProg at gmx.com> 
> wrote:
>>>> On Friday 14 January 2011 05:43:19 Robert Jacques wrote:
>>>>> On Fri, 14 Jan 2011 06:36:18 -0500, dsource.org <noreply at dsource.org>
>>>>> 
>>>>> wrote:
>>>>>> phobos commit, revision 2331
>>>>>> 
>>>>>> 
>>>>>> user: jmdavis
>>>>>> 
>>>>>> msg:
>>>>>> Re-enabled std.datetime for Windows but disabled its unit tests for
>>>>>> Windows.
>>>>>> 
>>>>>> For some reason, the std.datetime unit tests compile and pass without
>>>>>> problems on Linux and in Wine on Linux, but on real Windows, the
>>>>>> compiler runs out of memory when compiling them. So, for now, all of
>>>>>> the std.datetime unit tests are versioned with testStdDateTime. On
>>>>>> Posix, version=testdStdDateTime is used in std.datetime, so the
>>>>>> tests will run, but that version is not set on Windows, so the unit
>>>>>> tests don't run on Windows. So, if you want to run the std.datetime
>>>>>> unit tests on Windows or under Wine or Linux, then compile with
>>>>>> -version=testStdDateTime.
>>>>>> 
>>>>>> At the moment, all of the tests pass on both Linux and under Wine,
>>>>>> and the normal code does compile on proper, so I'm fairly certain
>>>>>> that it's fine
>>>>>> for use on Windows, but for now, I can't enable the tests on Windows.
>>>>>> My best guess is that it's some sort of weird compiler bug involving
>>>>>> system calls that leak memory on Windows-proper but not in Wine, but
>>>>>> I really don't know.
>>>>>> 
>>>>>> http://www.dsource.org/projects/phobos/changeset/2331
>>>>>> 
>>>>>> paths changed:
>>>>>> U   trunk/phobos/std/datetime.d
>>>>>> 
>>>>>> _______________________________________________
>>>>>> phobos mailing list
>>>>>> phobos at puremagic.com
>>>>>> http://lists.puremagic.com/mailman/listinfo/phobos
>>>>> 
>>>>> If DMD is running out of memory at compile time, I doubt it has to do
>>>>> with weird compiler bugs. DMD running out of memory is usually a sign
>>>>> of heavy compile time string manipulation, CTFE or template usage.
>>>>> Remember, DMD keeps all template instantiations in memory and every
>>>>> time a string or array is touched, a new copy is created (bug 1382).
>>>> 
>>>> Yes. But to then have it not only work on Linux but on Wine and yet not
>>>> work on Windows? The only real difference between running something
>>>> under Wine and Windows is that the implementation of system calls as
>>>> changed.
>>> 
>>> Well, is the crash due to a marginal difference in memory levels, or
>>> something major? i.e. is DMD's memory usage on Wine also very high, or
>>> is it relatively low.
>> 
>> I haven't had time to try to help with this.. but for what it's worth, the
>> windows test box has 2 gigs of ram and is running 32bit windows.  So, there
>> _ought_ to be pleanty of memory.
> 
> IIRC, looking at the dmd process on Linux, Wine, and Windows, Linux would max 
> out at around 100MB,  Wine would max out at around 300MB, and Windows would go 
> past 900MB and run out of memory (the numbers aren't terribly exact since I was 
> essentially just watching the task manager). Why it ran out of memory between 
> 900 and 1000MB, I don't know. My box has 64-bit Windows 7 and 16GB of memory 
> (though obviously dmd2, as a 32-bit program, couldn't use more than around 4GB). 
> So, it looks like dmd on Windows is declaring itself as out of memory well short 
> of the actual system limit. Regardless of that however, it's definitely using way 
> more memory than either Linux or Wine. All around, it's very weird.
> 
> I did open bug #5454 on the issue, and maybe someone dmd-savy will have time to 
> take a look at it. I'll keep poking at it when I have time, trying to generate a 
> reduced test case, but I really have no idea what could be causing it. 
> Regardless, it seems like it's either a bug in dmd or in Windows (and you'd 
> think that it would be dmd with the bug rather than the OS, but I don't know).
> 
> - Jonathan M Davis
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos


More information about the phobos mailing list