code: public void configureForLowMemUsage()
      {
          // StAX (1.0)
          doCoalesceText(false);
  
          // StAX2:
  
          doPreserveLocation(false); // can reduce temporary mem usage
  
          // Woodstox-specific:
          doCacheDTDs(false);
          doParseLazily(true); // can reduce temporary mem usage
          doXmlIdUniqChecks(false); // enabling would increase mem usage
          setShortestReportedTextSegment(ReaderConfig.DEFAULT_SHORTEST_TEXT_SEGMENT);
          setInputBufferLength(512); // 1k input buffer
          // Text buffer need not be huge, as we do not coalesce
      }
docs: Method to call to minimize the memory usage of the stream/event reader;
  both regarding Objects created, and the temporary memory usage during
  parsing.
  This generally incurs some performance penalties, due to using
  smaller input buffers.
  <p>
  See {@link XMLInputFactory2#configureForLowMemUsage} for
  required settings for standard StAX/StAX properties.
  <p>
  In addition to the standard settings, following Woodstox-specific
  settings are also done:
  <ul>
  <li>Disable <code>P_CACHE_DTDS</code>
  </li>
  <li>Enable <code>P_PARSE_LAZILY</code>
  </li>
  <li>Resets <code>P_MIN_TEXT_SEGMENT</code> to the (somewhat low)
  default value.
  <li>
  <li>Reduces <code>P_INPUT_BUFFER_LENGTH</code> a bit from the default
  <li>
  </ul>