Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

PerlApp (v.7) sharing perl58.dll

by fanticla (Scribe)
on Aug 09, 2010 at 17:11 UTC ( [id://853879]=perlquestion: print w/replies, xml ) Need Help??

fanticla has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks,

maybe this is a silly problem, but I didn't find any solution nor I understood if there is a solution at all:

I have x indipendent scripts I want to pack as x .exe using PerlApp. With standard settings, any .exe will contain a perl interpreter in order to work even if perl is not installed. As all my .exe files will stay togehter, I thought it could be possible to pack the perl58.dll only one time, allowing all other .exe to use this unique interpreter. Unfortunately I am not able at all to achive this. What I do now is to compile any .pl script as a .exe (everyone with perl58.dll). It works fine....but it uses a lot of memory.

Someone knowing if this is possible? I have read anything I found... without success.

Thank, cla

Replies are listed 'Best First'.
Re: PerlApp (v.7) sharing perl58.dll
by BrowserUk (Patriarch) on Aug 09, 2010 at 18:18 UTC
    What I do now is to compile any .pl script as a .exe (everyone with perl58.dll). It works fine....but it uses a lot of memory.

    Are you sure? (Ie. How are you measuring the memory usage?)

    Generally, only one copy of any given .DLL is loaded into memory regardless of how many processes use it.

    Although each process will display the memory used by the dll as a part of (one of the figures for) its memory consumption, as displayed in the task manager, second and subsequent copies will usually not consume extra from the total memory pool.

    Eg. If I run a do nothing perl process: perl -e"<>", and check the memory usage on the Process Manager main screen, it lists it as using 5,592kb. If I then double click that entry and look at the "Performance" tab, in the "Physical Memory" box, it show the working set as 5.592k. But that is divided into 3 subsets of memory

    1. WS private: 2,200k ## This is exclusive to this process
    2. WS shareable: 3,392k ## The rest (2,200 + 3,392 = 5,592) can be shared with other processes.
    3. WS shared: 2,512k ## Of the 3,392k, 2,512 is currently being shared.

      In this case, as there are no other Perl processes running, that will be things like the C runtime DLL, code pages etc. that are a part of other compiled C applications.

    And if you monitor the Physical Memory ("System Info" dialog), when you start that first copy of perl, you'll see that the Available memory drops by roughly 2.2 MB.

    If you then start a second copy of perl in another session, whilst continuing to monitor the Performance tab of the first, you'll see the WS shared increase to 3,388k. This is because the second copy of Perl is now sharing the Perl5x.dll that was loaded by the first perl process. Now almost all the shareable memory is being shared.

    So, whilst summing the main screen memory allocations for the two perl processes suggests they are using 5.592 * 2 = 11 MB, in fact between them they are only using 2.2 * 2 + 3.3 = 7.7MB. And of that 2.5 MB is being shared with other pre-existing processes.

    And when starting a third, instead of 16.5MB, only 9.9MB is actually consumed.

    This information doesn't mitigate the on-disk redundancy of each having it's own copy of perl5x.dll, but it might stop you worrying about memory consumed by them.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: PerlApp (v.7) sharing perl58.dll
by Jenda (Abbot) on Aug 09, 2010 at 19:46 UTC

    --xclude the perl58.dll and then install the dll alongside the exes.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

Re: PerlApp (v.7) sharing perl58.dll
by dasgar (Priest) on Aug 09, 2010 at 17:39 UTC

    I believe that you need to either include the DLL or have Perl installed on the machine. That's based on the following excerpt from the Perl Dev Kit User Guide:

        The PerlApp utility converts a Perl program into an executable file. The executable can be freestanding (for use on systems where Perl is not installed), or dependent (for use on systems where Perl is installed). Freestanding programs built with PerlApp are larger in size than dependent applications because required Perl modules are included in the executable.

    The only other alternative would be to copy the perl58.dll to the other machine. I believe that ActiveState's licensing does allow for that, especially since PerlApp is essentially bundling it into the stand-alone executables.

Re: PerlApp (v.7) sharing perl58.dll
by sundialsvc4 (Abbot) on Aug 10, 2010 at 03:41 UTC

    The guiding principle behind tools like these is:   “let it be guaranteed to work, no matter what.”

    Okay, so what is “the necessary trade-off” of that?   You guessed it: (1) file size, and (2) memory.   But, neither one of these things are (in this case...) judged to be important.   Quite the opposite ... they are sacrificial.   They are “the price to be paid.”

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://853879]
Approved by Corion
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-25 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found