Running low on memory

435 views
Skip to first unread message

Abdul Syed

unread,
Sep 14, 2021, 12:25:00 PM9/14/21
to SQL Workbench/J - DBMS independent SQL tool
Hi,

We have tried running a query which would copy about 3 lakh records from workbench output (Amazon Redshift) to excel.

Error message as follows:

The system is running low on memory.
To prevent data corruption, the current operation has to be aborted.
Please increase the heap size with -Xmx parameter.

Question:

Ram of our windows (64 bit) instance is 4GB.
C and D drive have capacity of 100GB each.
I currently see, 512 MB is assigned to workbench.
We are using 64 bit JRE.
To what extent can the memory be assigned to workbench/ _JAVA_OPTIONS?
Can we increase it to 8 GB?

From manual, I can see, we can increase it to 1.5GB with 32 bit JRE. 
But, No mention of size in case of 64 bit JRE.

Could you please clarify.

Thanks,
Abdul

Thomas Kellerer

unread,
Sep 15, 2021, 3:05:02 AM9/15/21
to sql-wo...@googlegroups.com
You can control the memory using the -Xmx parameters.

For details on how to specify it, please see the manual:

https://www.sql-workbench.eu/manual/install.html#install-increase-memory

or if you are using the Windows launcher:

https://www.sql-workbench.eu/manual/install.html#launcher-memory-parameter

Generating an Excel file requires a lot of memory, another option is to export the data as a CSV file that can be opened by Excel.
Generating that file requires much less memory.

You also might want to configure the JDBC driver to not buffer the whole result in memory.

I don't know Redshift or how closely it's alleged Postgres compatibility does, but with Postgres, it's possible to do this:

https://jdbc.postgresql.org/documentation/head/query.html#query-with-cursor

Thomas


Abdul Syed schrieb am 14.09.2021 um 12:44:
> Hi,
>
> We have tried running a query which would copy about 3 lakh records from workbench output (Amazon Redshift) to excel.
>
> Error message as follows:
>
> /The system is running low on memory./
> /To prevent data corruption, the current operation has to be aborted./
> /Please increase the heap size with -Xmx parameter./

Abdul Syed

unread,
Sep 15, 2021, 3:43:06 AM9/15/21
to sql-wo...@googlegroups.com
Okay, Currently 512 MB is assigned to the workbench.

If we increase that to 2 GB, 
Will that take space out of say, C drive 
OR
does that consume 2GB memory from RAM?

--
You received this message because you are subscribed to a topic in the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sql-workbench/BPsnP3AJJb4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sql-workbenc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sql-workbench/ef5cd0a5-c25b-7c66-8db9-5de2b2cebbbb%40sql-workbench.net.
Reply all
Reply to author
Forward
0 new messages