Results 1 to 6 of 6

Thread: [RESOLVED] How to check available memory?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2009
    Posts
    258

    Resolved [RESOLVED] How to check available memory?

    I have a need to monitor available memory while my application is running, as a hard number and compared to available memory. How can I do this?

  2. #2
    Addicted Member
    Join Date
    Mar 2010
    Location
    Southeast Michigan
    Posts
    155

    Re: How to check available memory?

    How about My.Computer.Info.AvailableVirtualMemory and My.Computer.Info.AvailablePhysicalMemory?
    Dave

    Helpful information I've found here so far : The Definitive "Passing Data Between Forms" : Restrict TextBox to only certain characters, numeric or symbolic :
    .NET Regex Syntax (scripting) : .NET Regex Language Element : .NET Regex Class : Regular-Expressions.info
    Stuff I've learned here so far : Bing and Google are your friend. Trying to help others solve their problems is a great learning experience

  3. #3
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: How to check available memory?

    And then use Math.Round to round it up and divide it by 1024 3 times to get GBs. This is assumnig every PC your application will interact with will have at least 1 GB memory. This is probably a safe assumption
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2009
    Posts
    258

    Re: How to check available memory?

    Dave, that worked fine. Thanks for the reference.

  5. #5
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: How to check available memory?

    Quote Originally Posted by HongKongCV View Post
    Dave, that worked fine. Thanks for the reference.
    Yeah... That wasn't passive at all...

    Did you do as I suggested so that you could get the size in a readable format? Or do you need to read it in bytes?
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2009
    Posts
    258

    Re: [RESOLVED] How to check available memory?

    No, the information isn't for display.

    I have a multi-threaded application that is running into problems... I get an "out of memory" exception. So I needed a way to track the memory usages so I can see when and where it starts to spiral out of control.

    In this instance, human readable in GB chunks is a drawback, not a benefit... more granularity in the raw numbers.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width