I am writing a small Java application (my first!) That does only a few things at the moment. He currently runs the Main class, which runs the gui class (the class I wrote that extends the JFrame, which only contains JTextArea), the class that loads the local file through BufferedInputStream, which is approximately 40kb, and the class that loads the record from Java properties file.
Everything works wonderfully, however, I looked at the Windows task manager and I noticed something that seemed strange to me. When I run the application, the RAM usage is about 40 MB, and it downloads a local file and pulls several values from it to display it in JTextArea, which seems normal to me for JVM, Java base classes, etc. However, however, when the application has finished downloading the file, it just sits idle, because at the moment I have nothing else. While he is sitting idle, while the window is active, the memory usage of the application starts to rise by 10-20kb every second. It seems strange to me. If I click on another program to make it an inactive window, the memory is still growing, but at a much lower speed (about 10 kb every 3-5 seconds).
I have not tested how far it goes, but it seems to me a very strange behavior. Is this normal Java behavior? I think it is possible that my code may be a memory leak, but I'm not sure how to do this. I really have to close the BufferedInputStream that I'm using, and I don't see what else could cause this.
I apologize if my explanation does not make sense, but I would appreciate any insights and / or pointers that anyone might have.
UPDATE:
On a suggestion, I basically turned off my application to the Main class, which simply calls the gui class. The gui class extends the JFrame and sets the window size, close operation, and visible properties. With these changes, the memory is still growing at 10-20 kb, but slower. This, combined with other tips that I received, makes me believe that it is just Java. I will continue to play with him and let you know if I find out anything interesting.