- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found that init HW decoding and then closing it, lead to memory leak. I saw ealier posts about leaks, but not sure if it have the same nature.
Here is code to reproduce issue:
[cpp]
static size_t GetProcessHeapSize(){
auto heap = GetProcessHeap();
if(!HeapLock(heap)){
return -1;
}
PROCESS_HEAP_ENTRY entry = PROCESS_HEAP_ENTRY();
size_t size = 0;
while(HeapWalk(heap, &entry)){
if(entry.wFlags & PROCESS_HEAP_ENTRY_BUSY){
size += entry.cbData;
}
}
HeapUnlock(heap);
return size;
}
static void MemLeak() {
mfxStatus sts = MFX_ERR_NONE;
mfxVersion ver = {4, 1};
mfxSession ses = mfxSession();
sts = MFXInit(MFX_IMPL_HARDWARE, &ver, &ses); // didn't reveal for software impl
mfxVideoParam cfg = mfxVideoParam();
cfg.mfx.CodecId = MFX_CODEC_AVC;
cfg.AsyncDepth = 1;
sts = MFXVideoDECODE_Init(ses, &cfg); // returns MFX_ERR_INVALID_VIDEO_PARAM
sts = MFXVideoDECODE_Close(ses); // returns MFX_ERR_NOT_INITIALIZED
sts = MFXClose(ses);
}
static void MemLeakTest() {
auto started = GetTickCount();
auto counter = 0;
while(true){
MemLeak();
auto ellapsed = GetTickCount() - started;
if(ellapsed > 1000){
printf("heap size: %d Kb, cnt=%d\n", (int)(GetProcessHeapSize() / 1024), counter);
started = GetTickCount();
}
++counter;
}
}
[/cpp]
This issue doesn't depend on whether MFXVideoDECODE_Init was succesfull or not. And it doesn't appear for SW implementation.
sys info:
[plain]
Intel Media SDK System Analyzer (64 bit)
The following versions of Media SDK API are supported by platform/driver:
Version Target Supported Dec Enc
1.0 HW Yes X X
1.0 SW Yes X X
1.1 HW Yes X X
1.1 SW Yes X X
1.3 HW Yes X X
1.3 SW Yes X X
1.4 HW Yes X X
1.4 SW Yes X X
1.5 HW No
1.5 SW Yes X X
1.6 HW No
1.6 SW Yes X X
1.7 HW No
1.7 SW Yes X X
Graphics Devices:
Name Version State
Intel(R) HD Graphics 3000 9.17.10.3223 Active
System info:
CPU: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
OS: Microsoft Windows 8 Pro
Arch: 64-bit
Installed Media SDK packages (be patient...processing takes some time):
Intel® Media SDK 2013 R2 (x64)
[/plain]
It is also reproduced with Intel Media SDK 2013 (x64) in 32 and 64 mode.
Are there any workarounds to prevent these leaks?
BTW why imsdk ver after 1.4 are not support HW acceleration, as I intalled last intel HD graphics (15.28.18) and directx11 is up to date?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
This appears to be a memory leak in the graphics driver. I'll make sure the driver team is aware of your sighting.
The Intel(R) 2nd Generation Core processors (with Intel(R) HD Graphics 3000 adapters) only support hardware features of (up to) API 1.4. Newer hardware supports new features.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page