My team will develop a web application program. We will use Java to do development. I have a question about Java.
Is it possible that Java code can cause memory leak because Java has garbage collector?
If java code can cause memory leak, which tool can I use to check memory leak in Java code.
Thank you for your answer.
I have another question.
I knew that it is necessary we need check Java code memory leak when web server is Windows NT platform.
Now, we use Sun Solaris as web server operating system. Do you think it is necessary we do memory leak checking on Java code running on Unix platform as Unix has own good memeory management.
I guess there are different types of memory leaks.
Firstly, memory we take from the heap and then forget to delete, as in C and C++ etc.
Secondly, as in Java, we might be creating objects that are expensive with memory and then the references to this memory never go out of scope and so whenever the GC decides it might like to do some work it leaves these objects alone.
Sometimes it is a simple matter of setting certain references to null at the appropriate time.
As for the JVMs, presumably some of them are implemented in C or C++ and so obviously there could be problems with the actual GC mechanism itself.