Thread overview
[Issue 7921] New: Two order of magnitude file size increase (up to 111 MiB for GtkD) mostly from zeroes
Apr 16, 2012
Denis
Apr 16, 2012
Denis
Apr 16, 2012
Denis
Apr 16, 2012
Walter Bright
Apr 17, 2012
Denis
Apr 17, 2012
Vladimir Panteleev
Apr 17, 2012
Denis
Apr 17, 2012
Denis
April 16, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7921

           Summary: Two order of magnitude file size increase (up to 111
                    MiB for GtkD) mostly from zeroes
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: verylonglogin.reg@gmail.com


--- Comment #0 from Denis <verylonglogin.reg@gmail.com> 2012-04-16 16:25:32 MSD ---
An example:

GtkD is built using singe (gtk-one-obj.lib) or separate (one per source file) object files (gtk-sep-obj.lib).

Than main.d that imports gtk.Main is built using those libraries.

Than zeroCount utils is built and launched over resulting files:
--------------------------------------------------
   Zero bytes|     %|    Non-zero| Total bytes|        File
      3628311| 21.56|    13202153|    16830464|gtk-one-obj.lib
      1953124| 15.98|    10272924|    12226048|gtk-sep-obj.lib
    127968798| 99.00|     1298430|   129267228|main-one-obj.exe
       743821| 37.51|     1239183|     1983004|main-sep-obj.exe
--------------------------------------------------

These zero byte counts are similar for dmd 2.054-2.057.

So one has to use very slow per-file build to produce a good (not 100
MiB) executable.
No matter what *.exe is launched, its process allocates ~20 MiB of RAM
(loaded Gtk dll-s).

See also:
"Building GtkD app on Win32 results in 111 MiB file mostly from zeroes" thread:
http://www.digitalmars.com/d/archives/digitalmars/D/Building_GtkD_app_on_Win32_results_in_111_MiB_file_mostly_from_zeroes_141758.html

A post in "Program size, linking matter, and static this()" thread: http://www.digitalmars.com/d/archives/digitalmars/D/Program_size_linking_matter_and_static_this_152387.html#N152875

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 16, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7921


Denis <verylonglogin.reg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #1 from Denis <verylonglogin.reg@gmail.com> 2012-04-16 16:27:26 MSD ---
This issue is fixed in dmd 2.058.
But no information about its source is given.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 16, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7921



--- Comment #2 from Denis <verylonglogin.reg@gmail.com> 2012-04-16 16:31:20 MSD ---
Created an attachment (id=1091)
Example with gtkD

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 16, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7921


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com


--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2012-04-16 14:24:17 PDT ---
Make sure first that it is not this issue:

http://dlang.org/faq.html#bss

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 17, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7921



--- Comment #4 from Denis <verylonglogin.reg@gmail.com> 2012-04-17 11:09:30 MSD ---
(In reply to comment #3)
> Make sure first that it is not this issue:
> 
> http://dlang.org/faq.html#bss

AFAIK there was no changes with BSS in dmd 2.058. And GtkD doesn't use __gshared arrays at all.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 17, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7921


Vladimir Panteleev <thecybershadow@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybershadow@gmail.com


--- Comment #5 from Vladimir Panteleev <thecybershadow@gmail.com> 2012-04-17 00:18:30 PDT ---
Have you looked at the map file?

If not, try my map treemap visualization tool: http://thecybershadow.net/d/mapview/

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 17, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7921


Denis <verylonglogin.reg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #1091|0                           |1
        is obsolete|                            |


--- Comment #6 from Denis <verylonglogin.reg@gmail.com> 2012-04-17 12:54:37 MSD ---
Created an attachment (id=1093)
Example with GtkD

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 17, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7921



--- Comment #7 from Denis <verylonglogin.reg@gmail.com> 2012-04-17 13:07:46 MSD ---
The example with built binaries for dmd 2.057 and dmd 2.058 (~10 MiB, uncompressed ~250 MiB): http://deoma-cmd.ru/files/other/huge-build-gtkD-full.7z

One can use Vladimir Panteleev's treemap visualization tool with *.map files from the archive (as for me, it hangs Chrome).

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