Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Failure to start 2nd Perl application

by bensonmonk (Novice)
on Oct 06, 2013 at 15:06 UTC ( #1057155=perlquestion: print w/replies, xml ) Need Help??
bensonmonk has asked for the wisdom of the Perl Monks concerning the following question:


I have an Perl application which starts another Perl application with the code

# path to Perl.exe $command_a = $cfg_perl_exe; # Perl.exe and the 2nd Perl application $command_b = 'perl.exe' . ' "' . $app_dir . $app_name . '"'; $ppc = Win32::Process::Create( $process, $command_a, $command_b, 0, NORMAL_PRIORITY_CLASS, '.' ); $process->Wait(INFINITE);

This has worked on a number of PCs with various flavours of windows os until now!

The PC which is failing has a specification of

Operation system Windows XP;

Physical memory 2GB;

Processor Intel Pentium dual core 1.6

When I try to start the 2nd application, the Physical Memory graph on the Performance tab of the Windows Task Manager shows a steady increase in memory usage from about 1.01 GB to 2.6 GB when the memory drops suddenly back to 1.01 GB with an indication that the 2nd process has finished (although it has not started fully).

Can anyone tell me why this has failed and how to get the 2nd application to start?

Replies are listed 'Best First'.
Re: Failure to start 2nd Perl application
by ig (Vicar) on Oct 06, 2013 at 17:54 UTC

    I can't tell you why it is failing but some questions come to mind...

    Which process is running out of memory? I'm guessing the second perl application, but you don't show your first script fully, so this is only a guess.

    Are you running the same second script successfully on other systems?

    What does the script that consumes memory then fails doing?

      It is the 2nd process

      I have run the same script on several other PC configurations and Windows operating systems without any similar difficulties.

      The 2nd failing script is a GUI application which uses facilities such as reading Excel files and building the GUI using Perl Tk

      I believe that most other PCs have more than 2 GB memory? Could the memory size be a problem?

        Can you run the second script to process the same data on other systems successfully? If you can, what is the maximum memory utilization on a system where it works?

        Is your Windows XP system 32bit or 64bit?

        If Windows XP is 64bit, is perl 32bit or 64bit?

        If Windows XP is 32bit or perl is 32bit then process virtual memory is limited to 2GB. If this is the case, given the data you are processing, is it reasonable that perl requires more than 2GB memory space?

        Are you running the same version of perl and all relevant modules on the Windows XP system as you are on the systems that are working?

Re: Failure to start 2nd Perl application
by Marshall (Abbot) on Oct 08, 2013 at 00:28 UTC
    This doesn't sound like an "out of memory" situation.
    Yes, that can happen, but it is unlikely upon startup.
    # $command_a should be the full path name # of the executable file. # $command_b should be the actual command. Your code: $ppc = Win32::Process::Create( $process, $command_a, #better? $full_path_to_cmd_exe $command_b, #better? $cmd_with_args 0, NORMAL_PRIORITY_CLASS, '.' ); Example from Win32::Process: $ppc = Win32::Process::Create( $ProcessObj, "C:/winnt/system32/notepad.exe", "notepad temp.txt", 0, NORMAL_PRIORITY_CLASS, "." );

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2018-09-26 04:25 GMT
Find Nodes?
    Voting Booth?
    Eventually, "covfefe" will come to mean:

    Results (205 votes). Check out past polls.

    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!