Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big Memory Leak on Windows [Bug] #401

Open
JavenRT opened this issue Jun 10, 2024 · 7 comments
Open

Big Memory Leak on Windows [Bug] #401

JavenRT opened this issue Jun 10, 2024 · 7 comments
Assignees
Labels
Bug 🐛 Something isn't working windows

Comments

@JavenRT
Copy link

JavenRT commented Jun 10, 2024

Unity Version

2023.1.20f1

AVPro Movie Capture Version

5.2.4

Which platform(s) are you using?

Windows

Which OS version(s) are you using?

Windows 11

Which rendering API(s) are you using?

Direct3D 12

Hardware

Processor: 13th Gen Intel(R) Core(TM) i9-13900HX 2.20 GHz
Installed RAM: 32.0 GB (31.7 GB usable)
System type: 64-bit operating system, x64-based processor

Which capture component are you using?

Capture From Texture

Capture mode

Realtime

Which output mode are you using?

Video file

Video codecs

H264

Audio source

Unity

Audio codecs

AAC

Any other component configuration

Frame Rate: 30
Source Texture: camera.targetTexture
Camera Render Resolution: HD_1920x1080
Output Target: Video File

The issue

We use a video recorder script that creates videos using this package, the videos are tours of a room and an audio clip is played through unity over the top. This functions perfectly fine on our Mac platform. On Windows however, it only works well the first time, if a second video is recorded we incur a memory leak of a few hundred mb every second, until we reach max memory and the application crashes. This occurs in builds, but also in editor. On occasion the leak does stop however the accrued memory is not released at any point. Additionally we have had builds were this issue was not present. After memory profiling we can see the memory is classed as untracked memory, meaning it must not be managed by the Unity Memory Management API (attached). It appears in private and system heap. We initially used an older version of the package but after trying the newest one 5.2.4, the issue persisted.
Build 1
build 2
image

Log output

No response

@JavenRT JavenRT added the Bug 🐛 Something isn't working label Jun 10, 2024
@JavenRT
Copy link
Author

JavenRT commented Jun 10, 2024

I should mention, we destroy the CaptureFromTexture object between each recording. And add the component again when it is time to record another.

@MorrisRH MorrisRH assigned RichRH and unassigned Chris-RH Jun 11, 2024
@richard12121212
Copy link

Hi We also run in this memory problem on windows. Is there any update on above?

@Chris-RH
Copy link
Contributor

Not at the moment.

@RichRH
Copy link

RichRH commented Dec 17, 2024

Hi @JavenRT and @richard12121212,

Apologies this has taken a while to look into.

I'm testing using Unity 6 (6000.0.31f1), D3D12, latest AVPro Movie Capture (5.3.3 - albeit debug build) and our 'Demo01-TextureCapture' scene in editor.

So far I'm not seeing any obvious memory leak - either by making multiple captures within the same play session or play/capture/stop/play/capture/stop etc..

A few questions whilst I keep digging:

  • Have you tried the latest Unity 6? (I've noticed Unity itself leaks quite a lot of D3D12 resources)
  • Have you tried the latest AVPro Movie Capture? (We've fixed a few memory leaks in our other products recently, some in shared code)
  • Can you reproduce the issue in our 'Demo01-TextureCapture' scene?
  • Does the issue occur with D3D11?
  • Does the issue occur if you use say H.264 instead of H.265?
  • Does the issue occur if you don't capture audio?

Apologies for all the questions but trying to narrow it down..

Cheers,

@JavenRT
Copy link
Author

JavenRT commented Dec 17, 2024

@RichRH This turned out to be user error for us we believe. It was found that we had two active Cinemachine brains in the scene which seems to cause the leak. Since fixing this we have not encountered the issue. At the time I had found that it was memory not managed by Unity so it's possible it's still related to this package but not something that can be encountered during normal use.

If it helps we did try the latest package available when the bug was reported and we did also disable audio but neither fixed the issue.

@RichRH
Copy link

RichRH commented Dec 17, 2024

Thanks for the confirmation @JavenRT - good to know no longer an issue for you.

Would be great if you could provide any further information (as listed above) @richard12121212..

Cheers,

@richard12121212
Copy link

yes it seems to happen when we select bigger resolutions for multiple recording streams.
we will give moreinfo this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 Something isn't working windows
Projects
None yet
Development

No branches or pull requests

5 participants