Optimize memory with Inline Strings
masterBy default, ws.value(row, col, string) uses shared strings. This is efficient for files with many duplicate strings but can consume significant heap memory if most strings are unique.
To reduce memory usage at the cost of larger file size, use ws.inlineString(row, col, string) to write strings directly to the cell without sharing them.
// Use this if you have many unique strings to save heap memory
ws.inlineString(0, 0, "Inline String");