running batch files: memory consumption increases steadily #19660

Closed
opened 2026-01-31 06:50:01 +00:00 by claunia · 13 comments
Owner

Originally created by @Matzeeee on GitHub (Apr 7, 2023).

Windows Terminal version

1.16.230126001

Windows build number

10.0.19045.2788

Other Software

No response

Steps to reproduce

In my terminal i have 5 tabs where various batch files are continuously running (in a loop).
When I start, the task manager shows me about 100 MB of memory for the terminal.
But the memory consumption runs up by about 100 MB every day!

The batch files don't really do anything special, they copy files or show me network parameters.

Expected Behavior

No response

Actual Behavior

memory consumption increases steadily

Originally created by @Matzeeee on GitHub (Apr 7, 2023). ### Windows Terminal version 1.16.230126001 ### Windows build number 10.0.19045.2788 ### Other Software _No response_ ### Steps to reproduce In my terminal i have 5 tabs where various batch files are continuously running (in a loop). When I start, the task manager shows me about 100 MB of memory for the terminal. But the memory consumption runs up by about 100 MB every day! The batch files don't really do anything special, they copy files or show me network parameters. ### Expected Behavior _No response_ ### Actual Behavior memory consumption increases steadily
claunia added the Needs-TriageIssue-BugNeeds-Author-FeedbackNo-Recent-Activity labels 2026-01-31 06:50:02 +00:00
Author
Owner

@lhecker commented on GitHub (Apr 10, 2023):

Task Manager only shows the total memory used by both Windows Terminal and all it's sub processes:
image

Could you expand it and check what exactly is being attributed to it, like so?
image

If you could provide a simple batch file that reproduces the issue (for instance by simulating the output of copying the files or something), that'd be super helpful! That way we could run it in a debug build of Windows Terminal and via the CRT debug heap figure out much faster where those allocations are coming from.

@lhecker commented on GitHub (Apr 10, 2023): Task Manager only shows the total memory used by both Windows Terminal and all it's sub processes: ![image](https://user-images.githubusercontent.com/2256941/230901393-fded8cb2-656c-4b81-ab81-10d5e04dff6e.png) Could you expand it and check what exactly is being attributed to it, like so? ![image](https://user-images.githubusercontent.com/2256941/230901457-684cd188-3159-4e01-8ba4-6690cba0af7d.png) If you could provide a simple batch file that reproduces the issue (for instance by simulating the output of copying the files or something), that'd be super helpful! That way we could run it in a debug build of Windows Terminal and via the CRT debug heap figure out much faster where those allocations are coming from.
Author
Owner

@Matzeeee commented on GitHub (Apr 17, 2023):

Hello,
here are 2 screenshots with about 20 hrs distance from TaskManager.
In the terminal (admin mode) 5 batch files are running (in a loop).

image

image

@Matzeeee commented on GitHub (Apr 17, 2023): Hello, here are 2 screenshots with about 20 hrs distance from TaskManager. In the terminal (admin mode) 5 batch files are running (in a loop). ![image](https://user-images.githubusercontent.com/60921150/232434011-35a2970a-f46f-43d0-ba74-e521106dc5a6.png) ![image](https://user-images.githubusercontent.com/60921150/232434083-5b6ac991-ed97-4d51-b6a4-991094f5306b.png)
Author
Owner

@zadjii-msft commented on GitHub (Apr 17, 2023):

Okay yea, we'll probably need to get a minimal repro batch file to investigate. This could just be the same thing as #14588, but without knowing for sure what the batch files are actually doing with the Terminal, we won't really be able to investigate the source of the leak.

@zadjii-msft commented on GitHub (Apr 17, 2023): Okay yea, we'll probably need to get a minimal repro batch file to investigate. This could just be the same thing as #14588, but without knowing for sure what the batch files are actually doing with the Terminal, we won't really be able to investigate the source of the leak.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Apr 21, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (Apr 21, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Apr 21, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (Apr 21, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Apr 21, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (Apr 21, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@Matzeeee commented on GitHub (Apr 24, 2023):

The batch files are very special and complex and they will not run on another system.
I can only state that I do not have the memory problem when they are not run in the terminal but directly in the console (cmd.exe).

@Matzeeee commented on GitHub (Apr 24, 2023): The batch files are very special and complex and they will not run on another system. I can only state that I do not have the memory problem when they are not run in the terminal but directly in the console (cmd.exe).
Author
Owner

@zadjii-msft commented on GitHub (Apr 24, 2023):

@Matzeeee Any way you could try and prune them down to a minimal repro/?

@zadjii-msft commented on GitHub (Apr 24, 2023): @Matzeeee Any way you could try and prune them down to a minimal repro/?
Author
Owner

@Matzeeee commented on GitHub (Apr 25, 2023):

i need some days...

@Matzeeee commented on GitHub (Apr 25, 2023): i need some days...
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (May 1, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (May 1, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (May 1, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (May 1, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (May 1, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (May 1, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (May 1, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (May 1, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19660