# Microsoft Access Connector Java Heap Space

**URL:** <https://forum.knime.com/t/microsoft-access-connector-java-heap-space/29133>\
**Category:** KNIME Analytics Platform\
**Created:** [December 3, 2020, 4:37pm UTC](https://forum.knime.com/t/microsoft-access-connector-java-heap-space/29133 "2020-12-03T16:37:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpsz](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/m/7ab992/32.png) [@mpsz](https://forum.knime.com/u/mpsz)\
**Post date:** [December 3, 2020, 4:37pm UTC](https://forum.knime.com/t/microsoft-access-connector-java-heap-space/29133/1 "2020-12-03T16:37:10Z")

</div>

Hi All,

I’m having troubles with MS Access connector trying to read a large MDB file (1.1GB).  
The connector node keeps running for some time and then it crashes with a Java Heap Space error.  
Seems that it´s trying to read the entire mdb file before passing the connection data to Table Selection node.  
It´s 8GB RAM machine running KNIME 4.2.3 Windows 10 and the heap space parameter is set to: -Xmx4096m  
The same flow runs Ok with smaller MDB files.

Here is my flow snippet:

![image](https://forum-cdn.knime.com/uploads/default/original/3X/9/0/9026fbbab138bcd6c2be4503bca680810ee5cb4f.png)

Following is the error log:

2020-12-03 11:43:33,015 : ERROR : KNIME-Worker-5-Microsoft Access Connector 0:84 : : Node : Microsoft Access Connector : 0:84 : Execute failed: Java heap space  
java.sql.SQLException: Java heap space  
at org.knime.database.util.Futures.throwDatabaseExecutionException(Futures.java:112)  
at org.knime.database.connection.impl.DBConnectionManager.initializeConnection(DBConnectionManager.java:516)  
at org.knime.database.connection.impl.DBConnectionManager.(DBConnectionManager.java:275)  
at org.knime.database.session.impl.DefaultDBSession.(DefaultDBSession.java:226)  
at org.knime.database.session.impl.DBSessionFactory.create(DBSessionFactory.java:81)  
at org.knime.database.session.DBSessionCache.getOrCreate(DBSessionCache.java:151)  
at org.knime.database.node.connector.AbstractDBConnectorNodeModel.registerSession(AbstractDBConnectorNodeModel.java:388)  
at org.knime.database.node.connector.AbstractDBConnectorNodeModel.execute(AbstractDBConnectorNodeModel.java:219)  
at org.knime.database.node.connector.file.FileDBConnectorNodeModel.execute(FileDBConnectorNodeModel.java:108)  
at org.knime.core.node.NodeModel.executeModel(NodeModel.java:576)  
at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1236)  
at org.knime.core.node.Node.execute(Node.java:1016)  
at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:558)  
at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)  
at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:201)  
at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)  
at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:334)  
at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:210)  
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)  
at java.util.concurrent.FutureTask.run(FutureTask.java:266)  
at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)  
at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)  
Caused by: java.lang.OutOfMemoryError: Java heap space  
at java.util.LinkedHashMap.newNode(LinkedHashMap.java:256)  
at java.util.HashMap.putVal(HashMap.java:631)  
at java.util.HashMap.put(HashMap.java:612)  
at com.healthmarketscience.jackcess.impl.ColumnImpl.setRowValue(ColumnImpl.java:560)  
at com.healthmarketscience.jackcess.impl.TableImpl.getRow(TableImpl.java:708)  
at com.healthmarketscience.jackcess.impl.TableImpl.getRow(TableImpl.java:688)  
at com.healthmarketscience.jackcess.impl.CursorImpl.getCurrentRow(CursorImpl.java:699)  
at com.healthmarketscience.jackcess.impl.CursorImpl$BaseIterator.next(CursorImpl.java:822)  
at com.healthmarketscience.jackcess.impl.CursorImpl$BaseIterator.next(CursorImpl.java:779)  
at net.ucanaccess.converters.LoadJet$TablesLoader.loadTableData(LoadJet.java:829)  
at net.ucanaccess.converters.LoadJet$TablesLoader.loadTableData(LoadJet.java:818)  
at net.ucanaccess.converters.LoadJet$TablesLoader.loadTablesData(LoadJet.java:1007)  
at net.ucanaccess.converters.LoadJet$TablesLoader.loadTables(LoadJet.java:1055)  
at net.ucanaccess.converters.LoadJet$TablesLoader.access$3200(LoadJet.java:261)  
at net.ucanaccess.converters.LoadJet.loadDB(LoadJet.java:1558)  
at net.ucanaccess.jdbc.UcanaccessDriver.connect(UcanaccessDriver.java:218)  
at org.knime.database.connection.UrlDBConnectionController$ControlledDriver.connect(UrlDBConnectionController.java:95)  
at org.knime.database.connection.UrlDBConnectionController.createConnection(UrlDBConnectionController.java:308)  
at org.knime.database.connection.AbstractConnectionProvider.createConnection(AbstractConnectionProvider.java:89)  
at org.knime.database.connection.impl.DBConnectionManager.lambda$2(DBConnectionManager.java:501)  
at org.knime.database.connection.impl.DBConnectionManager$$Lambda$1402/533676103.call(Unknown Source)  
at java.util.concurrent.FutureTask.run(FutureTask.java:266)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)  
at java.lang.Thread.run(Thread.java:748)  
2020-12-03 13:29:25,961 : ERROR : main : : WindowsDefenderExceptionHandler : : : PowerShell command powershell -inputformat none -outputformat text -NonInteractive -Command Get-MpComputerStatus -ErrorAction Stop | Select-Object -ExpandProperty AMServiceEnabled did not terminate successfully.  
2020-12-03 13:29:25,977 : ERROR : main : : WindowsDefenderExceptionHandler : : : Stderr is:  
2020-12-03 13:29:25,977 : ERROR : main : : WindowsDefenderExceptionHandler : : : Get-MpComputerStatus : NÃ†o foi possÂ¡vel executar o mâ€štodo extrÂ¡nseco.  
2020-12-03 13:29:25,977 : ERROR : main : : WindowsDefenderExceptionHandler : : : No linha:1 caractere:1  
2020-12-03 13:29:25,977 : ERROR : main : : WindowsDefenderExceptionHandler : : : + Get-MpComputerStatus -ErrorAction Stop | Select-Object -ExpandPropert …  
2020-12-03 13:29:25,977 : ERROR : main : : WindowsDefenderExceptionHandler : : : + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
2020-12-03 13:29:25,977 : ERROR : main : : WindowsDefenderExceptionHandler : : : + CategoryInfo : MetadataError: (MSFT\_MpComputerStatus:ROOT\Microsoft…pComputerStatus) [Get-MpComputer  
2020-12-03 13:29:25,977 : ERROR : main : : WindowsDefenderExceptionHandler : : : Status], CimException  
2020-12-03 13:29:25,977 : ERROR : main : : WindowsDefenderExceptionHandler : : : + FullyQualifiedErrorId : MI RESULT 16,Get-MpComputerStatus  
2020-12-03 13:29:25,977 : ERROR : main : : WindowsDefenderExceptionHandler : : :

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [December 4, 2020, 1:27pm UTC](https://forum.knime.com/t/microsoft-access-connector-java-heap-space/29133/2 "2020-12-04T13:27:25Z")

</div>

Hello @mpsz,

can you increase memory to 6GB and then give it a try? Additionally check this topic where @mlauber71 shared his experience with big MS Access databases:

> [@Accessing huge Microsoft Access DB](https://forum.knime.com/t/accessing-huge-microsoft-access-db/21559):
>
> Hi, I am using the standard MS-Access Node to for a MS-Access-DB. This database is quite huge (approx. 2GByte). When executing this node, it get’s not finished. Any hints how to deal with big MS-Access-databases? Thanks Werner

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [December 4, 2020, 2:21pm UTC](https://forum.knime.com/t/microsoft-access-connector-java-heap-space/29133/3 "2020-12-04T14:21:18Z")

</div>

Here are a few things you can try. First thing is to increase the memory allocated to KNIME like @ipazin suggested. Also you could try and make sure the MS Access DB does not contain any unwanted garbage and is compressed ([https://support.microsoft.com/en-us/office/compact-and-repair-a-database-6ee60f16-aed0-40ac-bf22-85fa9f4005b2](https://support.microsoft.com/en-us/office/compact-and-repair-a-database-6ee60f16-aed0-40ac-bf22-85fa9f4005b2)).

Then you could try and deactivate the “retrieve in configuration” setting in the Connector node. If this is active it will try and make sure that every setting and column is present before you are able to access it - which is useful but might slow down or hinder things with really large databases or murky connections. The downside is you would have to know what you are doing without additional checks.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/3/3/334ec46b1f3d795b38ef311c0c7f2a157d9bcadc.png)

You might see if there are further tweaks to the connector settings. Especially concerning timeouts (increase the time KNIME has to finish the operation).

Also if you just want to get data from the MS Access DB without big operations. Instead of the combination:  
DB Table selector -\> DB Reader

you could just use:  
[DB Query Reader](https://hub.knime.com/knime/extensions/org.knime.features.database/latest/org.knime.database.node.io.reader.query.DBQueryReaderNodeFactory)

So there would be no need for additional VIEW created.

And then you might want to make sure there is a maximum of Java Heap space available:

- So do not run any other workflows
- Make sure the workflow is as small as it gets
- maybe run a [garbage collector or heavy garbage collector](https://forum.knime.com/t/execute-failed-cannot-read-file-knime-container-20200301-1905559478659870280-bin-snappy/21461/19) before the operation

Here are some further hints about KNIME and performance you might want to check out:

> **[A meta collection about KNIME and performance and performance tuning and some...](https://hub.knime.com/mlauber71/spaces/Public/latest/_knime_performance_and_tuning)**
>
> A meta collection about KNIME and performance and performance tuning and some problems Please be aware: there might not be the one perfect setting for every ta…

OK and there are some hints concerning Windows Defender in your Log. So you might also want to check if there is no aggressive virus scanner hindering your jobs.

Also you might want to set the LOG level to DEBUG and see if further hints might come up.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 5, 2021, 2:21am UTC](https://forum.knime.com/t/microsoft-access-connector-java-heap-space/29133/4 "2021-06-05T02:21:19Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [October 22, 2024, 10:22pm UTC](https://forum.knime.com/t/microsoft-access-connector-java-heap-space/29133/5 "2024-10-22T22:22:49Z")

</div>

> [@mpsz](#):
>
> space parameter is set to: -Xmx4096m

4 GB to process a 1.5 GB table could be a tricky. Also Access is maybe not the best storage if you have other options.

> [@DB Writer to Access DB Hangs at 99%](https://forum.knime.com/t/db-writer-to-access-db-hangs-at-99/72090/6):
>
> @qdmt one idea could be to test H2/SQL database: [http://h2database.com/html/advanced.html#limits\_limitations](http://h2database.com/html/advanced.html#limits_limitations) You could [create a new database connection](https://forum.knime.com/t/sqlite-and-window-functions/31608/4) with a current H2 driver (from [Maven](https://mvnrepository.com/artifact/com.h2database/h2)) and add the “split” parameter to the connection string: jdbc:h2:split:[location=file?\<file\>][location=in-memory?mem:\<database\>] You will have to select this new “h2\_split” database driver in the [H2 Connector](https://hub.knime.com/knime/extensions/org.knime.features.database/latest/org.knime.database.extension.h2.node.connector.H2DBConnectorNodeFactory/) instead of the built-in one: The data would then be stored in a local [H2/S…](https://hub.knime.com/-/spaces/-/latest/~Ke-h87vETvtwqMaW/)
