Data Grid Rendering Thread vs Large Result Set Option: Which Approach Best Balances Memory Usage and Interactive Features?
0 reputation · 22 Jan 2020, 23:28 UTC
0 reputation · 22 Jan 2020, 23:28 UTC
When executing queries that return more than 100,000 rows, Oracle SQL Developer’s Data Grid can leak memory due to retained references in its rendering thread. A documented fix in 21.2 sets this thread to daemon mode, reducing the leak. Alternatively, the Worksheet’s Large Result Set option streams rows, preventing the leak but disabling interactive features such as sorting and inline editing.
Users need a reliable way to view large result sets without exhausting JVM memory, yet they also value the Data Grid’s interactive capabilities. The unresolved decision is whether future releases should default the rendering thread to daemon mode, potentially impacting long‑running queries that rely on non‑daemon cleanup.
35275 reputation · 23 Jan 2020, 00:12 UTC
To balance memory usage and interactive features, the Large Result Set option is the superior choice for stability, while the daemon rendering thread is a mitigation for memory leaks in the standard interactive grid. There is currently no documented method to stream large result sets while retaining full client-side interactivity (sorting and inline editing), as these features require the dataset to be resident in the JVM heap.
The choice between these two mechanisms depends on whether the priority is data manipulation or system stability:
Regarding the specific concerns of daemon behavior and automation:
To determine which approach is necessary for your specific environment, perform the following checks:
JVisualVM or JConsole to monitor the JVM heap. Compare the memory spike when loading 100k rows in standard mode versus the Large Result Set mode.Diagnostic Detail Needed: To refine this recommendation, please provide the current -Xmx (Maximum Heap Size) setting in your sqldeveloper.conf file, as the threshold for "leaking" is relative to available memory.
Use comments to ask for clarification. Post a solution as an answer.
6,040 reputation · 23 Jan 2020, 08:12 UTC
In Oracle SQL Developer 21.2 the Data Grid rendering thread can be switched to daemon mode. The thread then terminates automatically when the JVM exits, which stops the long‑running memory leak that occurs when it keeps a reference to every row in the grid. However, because it is a daemon, any resources it holds (such as file handles or sockets) are not explicitly closed until the JVM shuts down.
Enabling Large Result Set streams rows from the database as they arrive. The grid never buffers the full result set, so peak memory stays low. The trade‑off is that client‑side features that require a full in‑memory copy—sorting, inline editing, filtering—are disabled.
Many teams use a threshold (e.g., 100,000 rows) to automatically enable Large Result Set and set a moderate fetch size (5,000 rows). This keeps memory consumption manageable while still allowing limited client‑side sorting on the fetched subset.