Question: i am running an third party RMI-Server app providing exactly one method `("getImage()" returns an image as byte[]).` The implementation of this method (getting the image via a SOAP-WS) is provide by me.

The problem on running this RMI-Server is the high CPU consumption (measured with jvisualvm): 65% of cpu time go into `"sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run()"` and on second place with 15% is `"sun.net.www.http.KeepAliveCache.run()"`. The "real" work (scaling the image) comes on 4th place.
The server is running on win 2003 server. i guess there is something wrong with resource/connection handling?? but is this an implementation problem or a windows configuration-problem?

another observation is: if cpu utilization is high the memory utilization goes also up - the question is: is this because the gc can't do its work or many images waiting to be delivered. all i can say the memoryis used for `byte[]`.

so any ideas what to do?

thx in advance

Answer: 
If you are using DOM then you need to create a CDATA node instead of setting the block in a text node.

```
document.createCDATASection("foo");

```

* <http://download.oracle.com/javase/6/docs/api/org/w3c/dom/Document.html#createCDATASection(java.lang.String>)
It did exactly what you wanted. The stored data represents the String `"<![CDATA[test]]>"`!

If you use a API to create XML, just don't care for the way the XML is generated, since any parser will be able to parse it correctly. Just store the String `"test"` and be happy :).