Using axis call WebService, the system has been running for a period of time, an OOM has occurred, fortunately, the error message is noted in the log.
Exception in Thread "Thread-1301" Java.lang.OutOfMemoryError:Java heap Spaceat Org.apache.xerces.dom.DeferredDocumentImpl.createChunk (Unknown Source) at Org.apache.xerces.dom.DeferredDocumentImpl.ensureCapacity (Unknown Source) at Org.apache.xerces.dom.DeferredDocumentImpl.createNode (Unknown Source) at Org.apache.xerces.dom.DeferredDocumentImpl.createDeferredDocument (Unknown Source) at Org.apache.xerces.parsers.AbstractDOMParser.startDocument (Unknown Source) at Org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument (Unknown Source) at Org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity (Unknown Source) at Org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing (Unknown Source) at Org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source) at Org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source) at Org.apache.xerces.parsers.XMLParser.parse ( Unknown source) at Org.apache.xerces.parsers.DOMParser.parse (Unknown source) at Org.apache.xerces.jaxp.DocumentBuilderImpl.parse (Unknown Source) at Org.apache.axis.utils.XMLUtils.newDocument (xmlutils.java:369) at Org.apache.axis.utils.XMLUtils.newDocument (xmlutils.java:388) at Org.apache.axis.configuration.FileProvider.configureEngine (fileprovider.java:179) at Org.apache.axis.AxisEngine.init (axisengine.java:172) at org.apache.axis.axisengine.<init> (Axisengine.java : 156) at org.apache.axis.client.axisclient.<init> (axisclient.java:52) at Org.apache.axis.client.Service.getAxisClient (service.java:104) at org.apache.axis.client.service.<init> ( service.java:113) at catic.hotel.server.webservice.pmsservicedata.<init> (pmsservicedata.java:26) at Catic.hotel.server.task.sendcmdtask.<init> (sendcmdtask.java:200) at Catic.hotel.server.task.TaskFactory.getTask (taskfactory.java:155) at Catic.hotel.server.server.ReadData.read ( readdata.java:82) at Catic.hotel.server.server.ReadData.run (readdata.java:57)
Because the system will frequently enter into the sendcmdtask, and I again in this construction method constantly new Pmsservicedata (), and the pmsservice of the non-parametric construction method of the new Service (), The equivalent of causing the service object to be instantiated over time, oom occurs.
Workaround:
Use singleton mode for pmsservicedata, i.e.:
Private Static NULL ; // Single Case Public Static synchronized Pmsservicedata getinstance () { if(null = = pmsservicedata) { New Pmsservicedata (); } return pmsservicedata; }
Problem solving.
Non-stop instantiation of objects causes oom