Hello all,
I've been coming across an issue using Power Query in Excel 365 (Enterprise E3, both 32 and 64 bit version).
I have 4 Power Query data connections using an API query to retrieve JSON data automatically every 10 seconds, transform into a table.
I'm finding if I use VBA to initiate a Refresh All every 10 seconds, the Excel application memory usage just keeps growing until the RAM fills up.
Initially I was running 32-bit Excel and it would throw .NET out of memory errors at around 1.2GB, so I upgraded to 64-bit to see if it would stabilise at all.
However after running for a few hours, it was up to 4.5GB of RAM utilisation so it seems like there is some form of memory leak.
I've been through many forum entries looking at other suggestions to no avail:
- upgrading to 64-bit Excel
- turning off Data preview,
- turn off Background refresh,
- disable Auto-recover
- turn off telemetry
- load to data table
- turning on (and off) Fast Data load
I've also gone to the effort of creating a brand new worksheet using some dummy data (from https://www.oauth.com/playground API's) , with 4 brand new queries with only basic transformation (expand to table), and no other formulas nor any conditional formatting.
Plotting the memory working set over 30 mins, after opening (142mb) and before first refresh (215mb), after the first refresh it starts at 480mb and keeps just increasing (adding nearly 500mb in 30 mins).
The issue only really seems to happen if refreshing all queries simultaneously - including if manually clicking 'Refresh All'. Individually refreshing each query manually does not seem to trigger the memory leak (although I haven't manually refreshed for more than 5 minutes every 10 seconds manually).
If I stop the automated data refresh and just leave Excel sit open, after some time (possibly 10-30 minutes) it seems like some form of memory management / garbage collection does occur, as the memory utilisation will eventually start dropping.
Just wondering if there are any other tips or ideas that I haven't thought of, or is there genuinely a memory management issue when refreshing Power Query connections simultaneously?