Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8770687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:36:22+00:00 2026-06-13T17:36:22+00:00

I followed the top answer here, see below for code to get system memory

  • 0

I followed the top answer here, see below for code to get system memory being used at a given line in my perl code. I’m running Windows 7 Home Basic, 64 bit, 4 GB ram, 4.06 GB Virtual memory (As specified under advanced system settings under My computer). I got following message from perl at a line, before perl goes Out of Memory.

Memory usage: 1916346368

Assuming that this number is in bytes (= 1.78 GB), why did perl go Out of Memory? How can I get system total memory usage by all the processes?

Code block to compute memory is as below. I’m using Strawberry Perl 5.12.3.0

use Win32::OLE qw/in/;

sub memory_usage() {
    my $objWMI = Win32::OLE->GetObject('winmgmts:\\\\.\\root\\cimv2');
    my $processes = $objWMI->ExecQuery("select * from Win32_Process where ProcessId=$$");

    foreach my $proc (in($processes)) {
        return $proc->{WorkingSetSize};
    }
}

print 'Memory usage: ', memory_usage(), "\n";

Perl -V gives following info
http://pastebin.com/mvF7YgKH

Update: The problem got solved with 64 bit perl. But I also noticed that the program ran w/o hitch on 32 bit perl on Ubuntu. So, may be Strawberry perl on Windows takes more memory than perl on Ubuntu.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:36:23+00:00Added an answer on June 13, 2026 at 5:36 pm

    If you were trying to allocate, or reallocate, an enormous string, array or hash it could have requested a larger memory block than was available from the system. While you have 4 gigs of real memory and 4 gigs of virtual, other processes might have been consuming a large chunk of that.

    Alternatively, your system might have a per process memory limit which would might be 2 gigs.

    Finally, your OS may be 64 bit, but your Perl may be 32 bit. In that case the maximum amount of memory it can address would be 2 gigs. If you post a copy of perl -V somewhere we can view we might be able to work that out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, i followed this tutorial (code is down below on the page, just top
Previously I followed the instructions in another answer to get the infowindow to automatically
I followed this video tutorial for detecting memory leaks using Instruments with Xcode 4.3.2.
I followed the instructions given in the link: http://blog.avirtualhome.com/how-to-compile-a-new-ubuntu-11-04-natty-kernel/ for building a custom kernel
I followed this post http://neurochannels.blogspot.com/2010/05/how-to-run-r-code-in-matlab.html , to install R(D)Com server in order to call
I followed the example given in ember application stucture guide http://emberjs.com/guides/outlets/ in order to
The layout is basic: an EditText at the top followed by a ListView. EditText
I followed the excellent post by Nadia here jQuery override default validation error message
I have followed an online tut to get a full-size background using an inline
I've followed the Rails Tutorial up to the linked point. Here's the shell output:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.