To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
Article :: Building Dynamic Systems with Expressions in .NET
How Is XML Like An Interface?
Understanding Covariance and Contravariance
Print VS 2010 Keyboard Shortcut References in Letter (8.5x11in) and A4 (210×297mm) Sizes
Updated Productivity Power Tools



Go Back   VBForums > Visual Basic > Visual Basic .NET

Reply Post New Thread
 
Thread Tools Display Modes
Old Mar 16th, 2010, 07:11 AM   #1
HongKongCV
Lively Member
 
Join Date: Feb 09
Posts: 113
HongKongCV is an unknown quantity at this point (<10)
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?
HongKongCV is offline   Reply With Quote
Old Mar 16th, 2010, 10:24 AM   #2
dlscott56
Lively Member
 
Join Date: Mar 10
Location: Southeast Michigan
Posts: 116
dlscott56 is on a distinguished road (10+)
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
dlscott56 is offline   Reply With Quote
Old Mar 16th, 2010, 10:38 AM   #3
weirddemon
PowerPoster
 
weirddemon's Avatar
 
Join Date: Jan 09
Location: USA
Posts: 2,404
weirddemon has a spectacular aura about (125+)weirddemon has a spectacular aura about (125+)
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

Why you shouldn't arbitrarily bump threads.

Free 2010 Fluent Ribbon Control Suite (WPF)

Quote:
Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
weirddemon is offline   Reply With Quote
Old Mar 16th, 2010, 01:02 PM   #4
HongKongCV
Lively Member
 
Join Date: Feb 09
Posts: 113
HongKongCV is an unknown quantity at this point (<10)
Re: How to check available memory?

Dave, that worked fine. Thanks for the reference.
HongKongCV is offline   Reply With Quote
Old Mar 16th, 2010, 01:16 PM   #5
weirddemon
PowerPoster
 
weirddemon's Avatar
 
Join Date: Jan 09
Location: USA
Posts: 2,404
weirddemon has a spectacular aura about (125+)weirddemon has a spectacular aura about (125+)
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

Why you shouldn't arbitrarily bump threads.

Free 2010 Fluent Ribbon Control Suite (WPF)

Quote:
Originally Posted by SJWhiteley
"game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....
weirddemon is offline   Reply With Quote
Old Mar 16th, 2010, 01:28 PM   #6
HongKongCV
Lively Member
 
Join Date: Feb 09
Posts: 113
HongKongCV is an unknown quantity at this point (<10)
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.
HongKongCV is offline   Reply With Quote
Reply

Tags
memory

Go Back   VBForums > Visual Basic > Visual Basic .NET


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:04 PM.





Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.