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

Out of memory #24

Closed
tomaszwozniak123 opened this issue Apr 3, 2023 · 6 comments
Closed

Out of memory #24

tomaszwozniak123 opened this issue Apr 3, 2023 · 6 comments
Labels
question Further information is requested web Issues that affect Web

Comments

@tomaszwozniak123
Copy link

Hi,
When using NatMl VideoKit 0.0.12 I get this error when switching camera devices. Maybe it is connected with #23, but this one happens only sometimes, mainly after the first run.
Browser version: Chrome 111.0.5563.147
WebGL Unity 2021.3.20f1.

myapplication.cloudfront.net/:1 [.WebGL-000068A406CBB800] GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture.
myapplication.cloudfront.net/:1 [.WebGL-000068A406CBB800] GL_INVALID_OPERATION: Error: 0x00000502, in ..\..\third_party\angle\src\libANGLE\renderer\d3d\VertexDataManager.cpp, reserveSpaceForAttrib:520. Internal error: 0x00000502: Vertex buffer is not big enough for the draw call.
myapplication.cloudfront.net/:1 [.WebGL-000068A406CBB800] GL_INVALID_OPERATION: Error: 0x00000502, in ..\..\third_party\angle\src\libANGLE\renderer\d3d\VertexDataManager.cpp, reserveSpaceForAttrib:520. Internal error: 0x00000502: Vertex buffer is not big enough for the draw call.
Build007.loader.js:80 exception thrown: RuntimeError: memory access out of bounds,RuntimeError: memory access out of bounds
    at dlfree (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[134051]:0x29391ff)
    at il2cpp_codegen_marshal_free(void*) (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[2895]:0x13f7ed)
    at NatDevice_Name_m7BE4A206300A690F90B92697C3E540277F177766 (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[31499]:0xc64f19)
    at AudioDevice__ctor_mE8A1C592C648F889936191E95E8E557A845B30E6 (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[31497]:0xc64e91)
    at U3CDiscoverAudioDevicesU3Ed__20_MoveNext_m3947F1662EDDA93971217F8C7E67172E63FDE931 (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[31611]:0xc68152)
    at InterfaceFuncInvoker0<XmlQualifiedName_t2794880B373257E4108CC3F36D7373A343ACC5B9*>::Invoke(unsigned short, Il2CppClass*, Il2CppObject*) (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[19032]:0x9b57df)
    at dynCall_iiii (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[134309]:0x29495a7)
    at https://myapplication.cloudfront.net/Build/Build007.framework.js:1142:20
    at invoke_iiii (https://myapplication.cloudfront.net/Build/Build007.framework.js:22666:10)
    at List_1_AddEnumerable_m76C85811BC9C905E7224C054AD480C3062FA7700_gshared (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[3066]:0x147c37)
    at List_1_InsertRange_m386ABA9B2C4950D31E787C87CDEF3D3E103F1B1A_gshared (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[3060]:0x1477f6)
    at MediaDeviceQuery_DiscoverDevices_m0520738B6315FF77EFB342F12AB3CF55102140C5 (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[31596]:0xc67cfb)
    at MediaDeviceQuery__ctor_mE2C86815B53C8771C6F5BD82319E56505C59FF82 (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[31595]:0xc67b7c)
    at VideoKitCameraManagerCustom_GetNextTargetCameraDevice_m9380574BD557FF61F6CAE1A521899518DE5399D5 (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[32593]:0xcb543a)
    at NatMlMeetBackgroundRemover_SwitchCameraDeviceToTarget_mF727B58824BDA93FF90F16C8943B75A8A71D35A5 (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[32592]:0xcb5355)
    at HallwayViewModel_SwitchCameraToTarget_m04ABAD5FFB58C9FA8399D4233B2C97E367BE5417 (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[32653]:0xcb8514)
    at HallwayViewModel_SetupBindings_mFE85A06D529A292A245905F764C0FE7CB02F498E (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[32649]:0xcb8291)
    at HallwayViewModel_Start_mD1BD1C85DC59E11053F9FD98C15301F462C6A8B8 (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[32647]:0xcb7f1d)
    at RuntimeInvoker_TrueVoid_t4861ACF8F4594C3437BB48B6E56783494B843915(void (*)(), MethodInfo const*, void*, void**, void*) (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[106995]:0x1b8b794)
    at il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**) (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[109073]:0x1bb3470)
    at dynCall_iiii (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[134309]:0x29495a7)
    at https://myapplication.cloudfront.net/Build/Build007.framework.js:1142:20
    at invoke_iiii (https://myapplication.cloudfront.net/Build/Build007.framework.js:22666:10)
    at il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[109047]:0x1bb292e)
    at il2cpp_runtime_invoke (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[109117]:0x1bb4f99)
    at scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool) (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[133406]:0x28fe5eb)
    at ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[131381]:0x2868a96)
    at MonoBehaviour::InvokeMethodOrCoroutineChecked(ScriptingMethodPtr, ScriptingObjectPtr) (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[131321]:0x286386f)
    at MonoBehaviour::DelayedStartCall(Object*, void*) (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[131335]:0x2864fba)
    at DelayedCallManager::Update(int) (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[111940]:0x1c4eab4)
    at InitPlayerLoopCallbacks()::EarlyUpdateScriptRunDelayedStartupFrameRegistrator::Forward() (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[131072]:0x283ee3d)
    at ExecutePlayerLoop(NativePlayerLoopSystem*) (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[111761]:0x1c3df9d)
    at ExecutePlayerLoop(NativePlayerLoopSystem*) (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[111761]:0x1c3e039)
    at MainLoop() (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[128891]:0x26f8d62)
    at dynCall_v (https://myapplication.cloudfront.net/Build/Build007.wasm:wasm-function[134312]:0x29495c7)
    at https://myapplication.cloudfront.net/Build/Build007.framework.js:1142:20
    at browserIterationFunc (https://myapplication.cloudfront.net/Build/Build007.framework.js:15075:13)
    at callUserCallback (https://myapplication.cloudfront.net/Build/Build007.framework.js:13254:3)
    at Object.runIter (https://myapplication.cloudfront.net/Build/Build007.framework.js:13315:4)
    at Browser_mainLoop_runner (https://myapplication.cloudfront.net/Build/Build007.framework.js:13229:20)
printErr @ Build007.loader.js:80
@olokobayusuf
Copy link
Contributor

@tomaszwozniak123 Is VideoKit the only thing running? And can you profile your application without VideoKit? VideoKit itself has a relatively small memory footprint.

@olokobayusuf olokobayusuf added question Further information is requested web Issues that affect Web labels Apr 3, 2023
@tomaszwozniak123
Copy link
Author

tomaszwozniak123 commented Apr 3, 2023

Only VideoKit with Meet Segmentation is on this scene. There is some UI, and some logic for switch to the next scene and video player.
My guess is, that this is somehow connected to #23, maybe switching camera is causing some kind of memory overflow or sth.
Please take a look into the profiler screenshot (taken when scene is loaded without crash). Selected point is largest spike after loading scene.
image

@tomaszwozniak123
Copy link
Author

Here is snapshot from Firefox (first one is without NatML, second is when scene with NatML is active):
image

@tomaszwozniak123
Copy link
Author

Another lead to this maybe:
image

@olokobayusuf
Copy link
Contributor

@tomaszwozniak123 quick follow up on this: this is caused by an apparent memory access error, not by a lack of memory. We're working to publish an update tomorrow that fixes this.

@olokobayusuf
Copy link
Contributor

Fixed in VideoKit 0.0.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested web Issues that affect Web
Projects
None yet
Development

No branches or pull requests

2 participants