Power Query memory increasing when data connections refreshed simultaneously (manually or via VBA)

siers 16 Reputation points
2021-05-31T05:59:33.787+00:00

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.

100909-image.png

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?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,147 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bones 1 Reputation point
    2022-02-05T11:00:15.823+00:00

    Hi everybody,

    Two days ago, I got exactly the same problem after a Win 10 update. I update once in every month. I couldn't fix it within Excel.
    The problem exists on different PC.
    PC1: Win 10 Pro version: 21H2 build: 19044.1503 experience pack: 120.2212.4170.0 and Excel with MSO 365 (2201 build 16.0.14827.20158) 64 bites
    PC2: Win 10 Home version: 21H2 build: 19044.1466 experience pack: 120.2212.3920.0
    I have to remove the updates I will see what happens...


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.