简体   繁体   中英

How to measure the difference in memory usage between C# and Java?

I'd like to measure the difference in memory usage for an application in C# and Java. My theory is that, since the languages are quite similar, the memory usage between C# and Java, or perhaps between the CLR and the JVM, are quit similar.

However, I'd like to test this, and hopefully publish an article on it. What is a way to test memory between these 2 environments, and what are the things I have to take into account while measuring them? (For example, does the VM have a big impact on the memory usage? What technique should I use for measuring memory? And should I write a simple program without Frameworks, or include a Web Framework like Spring?)

So, just to clear on this: I'm not looking for opinions, but I'm looking for a method and the correct environment on how to create a test which objectively compares the two platforms.

For windows, there's a tool called VMMap . It's pretty low level memory analysis utility. It's possible to attach this to any running process, so you could analyse both .NET app and Java app with this.

This is one of the tools proposed in the new Konrad Kokosa book , too.

On the other hand, Linux platform is not so straight forward.

I hope that's all you need for that purpose.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM