vylan / javaapiforkml

Automatically exported from code.google.com/p/javaapiforkml
0 stars 0 forks source link

KML marshaling introduces memory usage concerns #35

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Marshaling the file i.e. kml.marshal(kmlFile);

What is the expected output? What do you see instead?
Generating the KML works. However, I used VisualVM and JMeter to profile the 
servlet app, and I noticed that marshaling the file keeps on loading classes in 
the memory on and on. This is a very big memory concern. I localized the 
problem by going through my code line by line.
What can be done regarding this? It is obvious that garbage collector is not 
deleting the object from the memory but it sure adds it again.
Any ideas?

What version of the product are you using? On what operating system?
Windows XP Professional 32bit, Eclipse Helios, Tomcat 6, JMeter

Please provide any additional information below.

Original issue reported on code.google.com by anb1...@gmail.com on 15 Sep 2011 at 9:59

Attachments:

GoogleCodeExporter commented 9 years ago
I've found out the problem. JAXB is not thread-safe for 
marshal/unmarshal/validate

http://stackoverflow.com/questions/3584821/jaxbcontext-newinstance-memory-leak

There is also link on how to fix this.

http://jaxb.java.net/guide/Performance_and_thread_safety.html

Can you guys make this thread-save/servlet safe for the next version?

Original comment by anb1...@gmail.com on 16 Sep 2011 at 5:18

GoogleCodeExporter commented 9 years ago
Was your problem about memory not being freed after marshalling (due to memory 
leaks?) or just about the total amount of memory required for marshalling.

For the second case, I'm exploring the possibility of marshalling chunk by 
chunk, see:
http://stackoverflow.com/a/9297719/809536

Original comment by theb...@emanueleziglioli.it on 15 Jan 2013 at 9:32