Hello. We are storing big nonXML documents (ej. 6Mb, 13Mb) into Tamino with TNonXMLObject and so.
I’ve detected that when doing such storage, the JVM memory usage grows quite high (e.g. 30Mb). Monitoring the inner allocated / free memory, there are memory usage peaks matching the nonXML insertion; after the document has been stored the memory is released.
I think the problem is that the JVM is reading the whole of the nonXML into memory, instead of just piping it out to Tamino.
I also think that the problem is not in the Tamino API itself, but in its use of the Sun’s [Http]URLConnection class that comes with Java. It seems that is this class the one that, before posting anything, reads it wholly into memory, in order to set the Content-Length HTTP header.
There is at least a freeware alternative for HttpURLConnection: HTTPClient (http://www.innovation.ch/java/HTTPClient/API/HTTPClient/HttpURLConnection.html). Now, I’ve tested it and:
- By just activating it, there is no change; HTTPClient does not use the HTTP chunked encoding to send the nonXML in small parts as I hoped and still reads the whole content in memory
- It is possible however to store nonXML into Tamino without such memory consumption with HTTPClient, by not using the Tamino API, setting previously the Content-Length header and then issuing a PUT directly to Tamino
So:
- Anybody has had the same problem?
- Anybody has used HttpClient for storing nonXML into Tamino, or for any other thing?
- Anybody has used direct PUT requests to store nonXML into Tamino? Any problem?
- Anybody can think on any other solution for that memory consumption problem?
Tnahk you,
#webMethods#API-Management#webMethods-Tamino-XML-Server-APIs