I'm working on a CGI script right now, and have come upon a problem with the following code:
my $Absolute_URL = "$gallerycfg{'UPLOAD'}/$imgparams{username}/$im +gparams{PicID}.jpg"; my $image = new Image::Magick; my ($image_x,$image_y) = $image->Ping($Absolute_URL); #Set to a high number for error trapping $imgparams{THREED}=5; #Determine if image is 3D based on width if ($image_x>$gallerycfg{'3DWIDTH'}){$imgparams{THREED}=1; }else{$imgparams{THREED}=0;} #Makes sure we got information on this picture. unless ($imgparams{THREED}<2){ &writelog ("Error blah blah $Absolute_URL.",1); &dieerr("The image blah blah inconvenience."); }
I've rewritten to code to prevent the problem, but what was happening was that if ImageMagick could not ping the image (that is, get its width), the script would cause the window's server memory usage to increase to over 800MB in less than a second. I looked in the task manager and found that the perl.exe process was using only around 20MB! Again, I rewrote the code to check on $image_x, but was wondering why so much memory would be allocated so quickly for an undefined variable problem and where that memory might have gone. Again, looking through the process list showed only a total of maybe 100MB memory useage. Any ideas? Thanks

In reply to Undefined value in gt (>) -> 800MB memory usage by lpoht

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.