Skip to Main Content

SQLcl

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

22.4: "Warning: This LONG setting may cause Java memory problems."—really?

user_2DKLADec 16 2022 — edited Jan 7 2024

SET LONG nnnn , with nnnn high enough, triggers a warning message in 22.4:

If using -Xmx2g (MaxHeapSize = 2147483648 bytes):

SQL> set long 2147483  -- OK, no warning

SQL> set long 2147484  -- causes SQLcl to bark:

Warning: This LONG setting may cause Java memory problems.
It is recommended to reduce the setting and/or increase the memory available to Java.

If using -Xmx4g (MaxHeapSize = 4294967296 bytes):

SQL> set long 4294967  -- OK, no warning

SQL> set long 4294968  -- causes SQLcl to bark:

Warning: This LONG setting may cause Java memory problems.
It is recommended to reduce the setting and/or increase the memory available to Java.

So it looks like the threshold for this warning is set to 0.1 % of the maximum size of the Java heap…

And that seems very low: SET LONG must be set high enough in order to properly spool large CLOBs into text files (e.g. SQL Monitoring reports), and for that I wouldn't care using large chunks of memory—even with a heap size capped at 1.5 or 2 Gb, what's a couple of tens of Mb these days?

Or do I miss something here?

Thanks & regards,

[EDITED: 7 Jan, 2024: fixed text formats for the current version of Forums software.]

Comments
Post Details
Added on Dec 16 2022
4 comments
371 views