Powershell Universal Memory Consumption

Product: PowerShell Universal
Version: 2.6.1

I currently have a single dashboard along with about 5 apis and this morning I noticed that PSU was using 6gb of memory by itself. What are the most common reasons for this and what can I do to limit memory usage?

edit: looks like somebody else had some issues with DBAtools on an older version, which I am currently using as well Best way to troubleshoot high memory and CPU usage? (and crashes) - #6 by McAndersDK

I’ve recently analyzed some memory dumps where dbatools was the culprit. It was happening due to the way dbatools queues up logs. It never seems to release them from memory.

Are you using the most recent version? The other user upgraded their dbatools version and the issue was resolved.

Under the context/scope of PSU, how would I go about getting the correct version number of a module?

I don’t see DBATools in C:\Program Files (x86)\Universal\Modules

Click Platform \ Modules and then search for dbatools.

It looks like they are local because I think I ran install-module in one of the scripts itself?

Looks like the most up to date version is 1.1.44. What is the proper way of updating this module in PSU and should I be installing it under the PSGallery tab somehow? Not sure if that makes a difference.

If you install it via PSU, it will install it to the repository directory. I’m not sure it will load it first. We don’t have a method of updating modules yet.

You could also run a script in PSU that calls Update-Module on dbatools.

Was just perusing and saw this. Please file an issue on the dbatools repo (Redirecting…) if you continue to have memory issues after you upgrade dbatools and we’ll take a look.

1 Like

Yea there is definitely some sort of memory leak I am unable to fix on the latest version. Would they be able to help even though this is a 3rd party software I am using it with?

Issue opened:

1 Like

Thanks so much! This should be resolved in version 1.1.48, released just now. Please let me know if it does not address your issues.


Yep I saw that earlier today. Appreciate all the help! I will be sure to install the latest version of dbatools on my PSU server and will let you know if that fixes the memory leak issue.