Configuration Aalto StAX Parser For Low Memory Environment

Overview

In certain cases, Aalto may need to process large XML documents in low memory environment. In such a scenario, Aalto can be configured to work optimally under low memory condition.

In this article, we shall see how to configure Aalto for low memory usage.

Create employee.xml as shown below.

Create TestConfigureLowMemory as shown below.

The configuration for low memory usage is defined using
XMLInputFactory2.configureForLowMemUsage()
(see line 17 below). This shall optimize Aalto parser so that memory usage is optimized.

The output of the program is shown below.

Download Source Code for this Program

Leave a Comment