User Interface | SmartSync | GenericSync | Persistence | Trace | General Programming Tips

 

Performance Recommendations - GenericSync

Recommendation

Description
Use readNextElement() on InboundContainer instead of getAllElements(), getElementsWithFieldName(String fieldName) and getElement(String fieldName, String lineNumber)

The methods getAllElements(), getElementsWithFieldName(String fieldName) and getElement(String fieldName, String lineNumber) need the entire container in memory.

The method readNextElement() is not so memory consuming. Take care about the following:

  1. Do not mix the method readNextElement() with the methods getAllElements(), getElementsWithFieldName(String fieldName) and getElement(String fieldName, String lineNumber).
  2. The method readNextElement() has to be called in InboundProcessor.process(InboundContainer) - do not store references to the InboundContainer and process them outside the method InboundProcessor.process(InboundContainer).