x


Using Microsoft.VisualBasic (or other ways of getting memory info)

I know what you're thinking: "why on earth are you worried about Visual Basic libraries in Unity?"

I'm trying to get some system memory information, and according to this thread I can get what I need with VisualBasic.Devices. If you have other suggestions for getting memory information (e.g. RSS and available system memory), I certainly recognize that I am not a power programmer and I'm open to any suggestions.

Within Visual Studio I can add a reference to Microsoft.VisualBasic and then include it in my C# code through 'using' directives. However, I've noticed that the version being used is .NET 4.0 (so I can't just import it into Unity), and when I try to grab the .NET framework 2.0 from the Microsoft site it tells me that it's already installed, even though I only see the 3.0, 3.5, and 4.0 frameworks on my (Windows) system (Program FilesReference AssembliesMicrosoftFramework)

So in summary, I have 3 questions:

  • Is there a recommended way within the Unity framework to query the amount of memory in use by the application and the amount of available memory?
  • If not, is there any way to get the VisualBasic.dll for, say, .NET 4.0 to work in Unity?
  • If not, can you tell me how/where I would go about getting the VisualBasic.dll for .NET 2.0?
more ▼

asked Nov 09 '11 at 06:29 PM

Julien.Lynge gravatar image

Julien.Lynge
7.4k 20 25 51

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first
more ▼

answered Nov 09 '11 at 11:06 PM

DaveA gravatar image

DaveA
26.5k 151 171 256

Dave, I'm actually looking for something that's platform independent. The suggestions on that page seem to center around kernel32.dll, which I'm guessing makes them Windows only. Of course, I hadn't thought about that with respect to VisualBasic.Devices - is that also Windows only when compiled into a Mono executable?

There has to be some way or combination of ways to poll memory on Windows, Mac, webplayer, and mobile.

Nov 13 '11 at 03:05 AM Julien.Lynge
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x328
x235

asked: Nov 09 '11 at 06:29 PM

Seen: 686 times

Last Updated: Nov 13 '11 at 03:05 AM