Runtime.exec() : Memory management
Hello, I tried to search during hours, without success, to know how the memory is shared(or not) between a current Process and a process created with Runtime.exec().
My real question is "Does the memory used in the subprocess is the same as the one used by the father process or does a new memory space is created for this child process?"
Moreover, do you know where I can find documentation on how JVM manage memory in such case (Runtime.exec)?
Thanks
Micka雔
[490 byte] By [
mdvoxa] at [2007-11-26 18:10:15]

# 1
The simple answer is that the child process gets its own memory. Runtime.exec() relies on the underlying operating system to create a new process; on Solaris and Linux it is implemented with calls to fork() and exec() and on windows it uses CreateProcess().
The not-so-simple answer is that some memory associated with the process is shared, although it's either read-only or copy-on-write. If you need more details, you'll have to look at your operating system documentation.
jxca at 2007-7-9 5:42:30 >
