Configure NRE Memory

You can manually configure a controller’s NRE (Node Runtime Environment) memory pool settings to improve system performance. Depending on how the station is programmed, you may need to adjust the allocations. However, there is a fine balance between these memory pool settings. Since there is a finite amount of memory available, increasing one allocation decreases another.

In Niagara 4.11, the file system writes the alarm and history data, which used to be stored on the RAM Disk, directly to the flash memory. This change frees up 384MB of RAM and improves performance. The file system relocates the available space to the Heap Space, Meta Space, and Code Cache memory pools. Any additional memory space is available as general free memory.

 CAUTION: Configuring a controller with insufficient memory allocations could prevent the station from starting or could cause the station to fail and restart. 
Figure 41.   Configure NRE Memory Pools window without RAM Disk memory (as of Niagara 4.11)
Image

NRE memory default sizes in MB:

System Reserve Size 0
Heap Space Size 384
Meta Space Size 128
Code Cache Size 32
Free Memory ~352
 NOTE: A fixed memory footprint serves all the memory pools. Adjusting one pool affects at least one other pool. 

To access Configure NRE Memory Pools window, open the Platform Administration view and click Configure NRE Memory. The descriptions shown in the window include recommended allocation sizes. Additional details about the types of memory pools are described here:

  • System Reserve allows you to allocate additional free operating system space. By default, this is set to 0MB. The reason you might reserve additional free operating system space is if additional system RAM is needed when any new thread is spawned by the station or niagarad (daemon) for native stack and overhead.
  • Heap Space is where the station runs. As your program grows it requires more memory (heap).
  • Meta Space holds all of the Java classes that are loaded from the modules. As you install more drivers, this increases the number of jar files holding the classes.
  • Code Cache holds code that has already been compiled. Java functions with a JIT (Just-In-Time) compiler. As Java executes classes it compiles code “on the fly”. Saving code that it has already compiled to the Code Cache eliminates the need to compile it again on the fly. Code that is used most often is cached. However, since there is a limited amount of memory available to cache code, it continues using the compiler as the station is running. If you adjust the memory allocation to allow a significant amount of space for code caching the station will run faster, but the risk is taking away too much memory from the other memory space resulting in the station being unable to run at all.
If you adjust the space allocation for any of the memories described above, you must reboot the controller for the new configuration to become effective.

In Niagara 4.10u1 and earlier, the RAM Disk temporarily stores alarm and history data. During station save, the system copies the data over from the RAM Disk, zips them up and stores them to the flash memory.

Figure 42.   Configure NRE Memory Pools window with RAM Disk memory ( Niagara 4.10u1 and earlier)
Image

NRE memory default sizes in MB:

System Reserve Size 0
Heap Space Size 360
Meta Space Size 56
Code Cache Size 16
RAM Disk Size 384
Free Memory ~16