www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5454] New: Compiling std.datetime's unit tests on Windows causes dmd to run out of memory

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5454

           Summary: Compiling std.datetime's unit tests on Windows causes
                    dmd to run out of memory
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: jmdavisProg gmx.com



PST ---
Okay. This is a weird one. std.datetime compiles fine on both Linux and Windows
if you don't use -unittest. It compiles and runs fine with -unittest on Linux.
It compiles and runs with with -unittest on Linux in Wine. However, if you try
and compile with -unittest on Windows-proper, dmd runs out of memory. If I
comment out a bunch of unit tests, then it doesn't run out of memory, but I
haven't been able to find anything which would seem to be the issue other than
the large number of unit tests that there are. Or maybe it even has to do with
module size rather than anything specific to unit tests and adding in the unit
tests makes it too large for Windows somehow. I don't know.

However, regardless of what dmd running in Windows doesn't like about
std.datetime's unit tests, it definitely runs out of memory if you compile them
in. What I find truly strange about this is that it works just fine in Wine,
which would imply that there's some bug in a Windows system call or something
similar - or perhaps a bug with how dmd deals with some system call and memory.
I'm really not knowledgeable enough to have a very good idea of what the
problem might actually be though.

I'll continue to try and get smaller test case and/or narrow down the problem,
but I have no clue about how to go about debugging dmd for how and why it's
leaking memory like crazy.

IIRC, while compiling, Linux hit somewhere around 100MB, Wine hit around 300MB,
and Windows went over 900MB and ran out of memory. So, there's something that
is not only Windows-specific, but it's Windows-specific enough that Wine
doesn't have the problem (which is usually the opposite of what happens with
Wine).

For the moment, all of the unittest blocks in std.datetime have their body in a
version(testStdDateTime) block, so the tests don't run on Windows unless you
build with -version=testdStdDateTime. The unit tests do pass in Wine, so I
believe that the code is solid, but the fact that the compiler runs out of
memory on Windows is a big problem.

If it matters, I was testing it on a 64-bit Windows 7 install, but the same
problem occurs on the autotest machine with whatever version of Windows it's
using.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 14 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5454




PST ---
Actually, it looks like I screwed up in my testing. Wine probably has the
problem too.

When building and running the tests on Linux and Windows, I built and ran
(well, tried to run on Windows) the entirety of Phobos. However, since I have
yet to be able to figure out how to compile druntime with Wine, I compiled and
ran only core.time and std.datetime when testing Wine. So, I just tried doing
that for all three.

On Windows and Wine, dmd uses about 370MB, but does not run out of memory when
just compiling core.time and std.datetime. On Linux, it uses about 270MB (so,
evidentally, I did a poor job reading the memory consumption on Linux before).
So, there's a definite increase on both Windows and Wine, but neither runs out
of memory when just compiling core.time and std.datetime. Windows definitely
runs out when compiling all of Phobos with std.datetime's unit tests enabled,
but it doesn't if it's just core.time and std.datetime. Linux does fine with
all of Phobos, but my guess is that Wine does just as poorly as Windows if you
compile all of Phobos' unit tests (though I haven't been able to test it).

So, it doesn't look like it's Windows vs Wine problem at all, but it's still a
Windows vs Linux problem.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 14 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5454


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |WORKSFORME



01:34:51 PDT ---
I run the datetime unit tests on Windows all the time, and it doesn't run out
of memory.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 28 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5454




PDT ---
It doesn't anymore, because of changes to std.datetime (primarly changes to the
unit tests IIRC). I'm fairly certain that the underlying problem still remains
(probably related to templates, given the large number of template
instantiations that were happening with _assertPred and other testing stuff),
but unfortunately, you can't really test it anymore, since std.datetime has
changed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 28 2012