- Home /
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 Files\Reference Assemblies\Microsoft\Framework)
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?
Answer by DaveA · Nov 09, 2011 at 11:06 PM
There may be some clues here (Windows): http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/b634cc1e-55e2-4f47-ab4d-aeca26dd26ce
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 $$anonymous$$ono executable?
There has to be some way or combination of ways to poll memory on Windows, $$anonymous$$ac, webplayer, and mobile.