KhronosGroup / KhronosGroup/SPIRV-Cross

Memory Usage Jumps by 200MB upon first invocation of the compiler (Debug build)

Open
#1,234 4 comments 0 reactions 0 assignees View on GitHub
needs triage question
Dominant language
GLSL
Stars
2.5k
Forks
713
Avg merge
2d 18h
Merged PRs (30d)
16

Description

This is how we use the SPIR-V API
https://github.com/buildaworldnet/IrrlichtBAW/blob/974d0ff631f65e92d662aca5582e33d6ac4e5c49/src/irr/asset/IGLSLCompiler.cpp#L10

Looking at the Visual Studio memory analyzer, my memory usage jumps by about 200 MB as soon as the SPIR-V compliation function is invoked.

I also used heap snapshots, on breakpoints before and after and the compile, fist time round I can see some allocations from `static` variables (such as string maps for different stuff like variables, etc.) but they don't match 200MB increase exactly.

Second time I come to compile, I don't get the 200MB jump.

I'm fine with a 200MB memory usage while compiling, but there should be a way to "fully deinitialize" SPIR-V cross to reclaim the 200MB after I'm done compiling all my shaders.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at src/irr/asset/IGLSLCompiler.cpp#L10 and inspect the SPIR-V compilation entry point described in the report. Compare memory before and after the first and second invocations using Visual Studio heap snapshots; done means determining whether the first-use allocations can be fully deinitialized to reclaim the reported memory.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.