I know that making a memory scanner is already available in C#, but I was wondering if there is an equivalent in Java, and if it is even possible.
Asked
Active
Viewed 1,785 times
-1
-
What do you mean by "memory scanner"? Are you looking for something like [VisualVM](http://visualvm.java.net/), that has some memory-related tools? Not sure if it looks through the entire memory or just the JVM's, though. – Marcelo Feb 20 '12 at 14:29
-
does this http://stackoverflow.com/questions/390449/determining-java-memory-usage answer your question? – Scorpion Feb 20 '12 at 14:30
-
1@user1212527: for a start on a properly designed OS you won't be able to scan the entire memory of a system unless you happen to have admin/root rights. Then you certainly cannot do it natively in Java. Java is very probably the very wrong tool for the job here although you *could* call native C code (or whatever) from Java using JNI/JNA/etc. Curiosity: what are you looking for in memory? Viruses? Rootkits? Sensitive data left in the clear by programs that aren't cautious enough? – TacticalCoder Feb 20 '12 at 14:33
1 Answers
3
I don't know any such software written in Java, but yes, it is doable.
However, due to the very low level of the task to perform, reading the memory can't be directly done in Java itself. You need to access the operating system native calls using JNI, or another library giving you access to the native libraries.

Vivien Barousse
- 20,555
- 2
- 63
- 64