• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading RAM  RSS feed

 
Ender Ak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How can i read all computer memory with java ? is it possible?
 
Pat Farrell
Rancher
Posts: 4686
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no.
you can read all of userspace memory.
You can not read kernel space memory
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To compound the issue.... What is user space and kernal space is determined by the MMU. And this is specific to a program. In other words, there many be multiple value at address XXXX, since XXXX is a virtual address.


So... even if you use JNI, which will get your program to C/C++, it will not be able to access all of the physical memory in the system.

Henry
 
Ender Ak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot for your answers...
i think it is very tough subject.. i will resarch computer memory and how it works..
so if found something usefull i will share..
 
Sathish Nagappan
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you want to have your cake and eat it too. :-). Java is a closed system, meaning it really does not allow the programmer much power on system side operations such as reading in raw bytes of data directly from the memory. You would need to have references to memory locations by means of object references.

However if you wish to access main memory for specific requirements, you may want to use native bindings and allow C or C++ to work at the memory and framing some sort of object which can be sent back to the Java programs at the higher levels.

This is yes, not for the beginner Java geek. Might take quite a bit of time and research. Study on JNI and a little bit of C, will help you out.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!