Have you tried appying PolyML.shareCommonData to the function you are exporting as in the following example from http://www.polyml.org/docs/Version5ReleaseNotes.html ?
$ poly Poly/ML 5.0 Release
fun f () = print "Hello World\n";
val f = fn : unit -> unit
PolyML.shareCommonData f;
val it = () : unit
PolyML.export("hello", f);
val it = () : unit
^D
Phil
Lucas Dixon wrote:
Hi PolyML people,
I'm interested in trying to shrink the size of my binary/heap file;
I have 18604 lines of library code; the first 6922 lines give a 2.6 MB heap; the next 1200 lines on top of this give a 15 MB heap. I then have 7500 lines of program that push the heap up to 138 MB. (on some Linux' this becomes over 200MB!)
I'm doing garbage collection before writing the heap (although it sounds like this is now done automatically); and I can't quite tell how I'm getting this rather nasty blow up in heap size.
I suspect my use of substructures, I often have things like:
signature N1 ... signature N2 = sig structure n1 : N1 ... end
functor N2Fun(n1 : N1 and ...) : N2 = struct structure n1 = n1; ... end;
structure n1 : N1 = ...
structure n2a = functor(n1 : N1 and ...) : N2; structure n2b = functor(n1 : N1 and ...) : N2;
is the code for the substructure n1 literally getting copied each time?
Even with this I find it hard to imagine how I'd generate 120 MB of machine code from 7500 lines of ML...
I noticed some forget functions in the PolyML compiler; is there some clever way to say all I care about is stuff reachable from calling some specified function?
suggestions very welcome,
best, lucas _______________________________________________ polyml mailing list polyml@inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
The information contained in this E-Mail and any subsequent correspondence is private and is intended solely for the intended recipient(s). The information in this communication may be confidential and/or legally privileged. Nothing in this e-mail is intended to conclude a contract on behalf of QinetiQ or make QinetiQ subject to any other legally binding commitments, unless the e-mail contains an express statement to the contrary or incorporates a formal Purchase Order.
For those other than the recipient any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance on such information is prohibited and may be unlawful.
Emails and other electronic communication with QinetiQ may be monitored and recorded for business purposes including security, audit and archival purposes. Any response to this email indicates consent to this.
Telephone calls to QinetiQ may be monitored or recorded for quality control, security and other business purposes.
QinetiQ Limited Registered in England & Wales: Company Number:3796233 Registered office: 85 Buckingham Gate, London SW1E 6PD, United Kingdom Trading address: Cody Technology Park, Cody Building, Ively Road, Farnborough, Hampshire, GU14 0LX, United Kingdom http://www.qinetiq.com/home/notices/legal.html