API Reference > imodeljs-frontend > Rendering > RenderSystem > contextLossHandler contextLossHandler MethodStatic A function that is invoked after the WebGL context is lost. Context loss is almost always caused by excessive consumption of GPU memory. After context loss occurs, the RenderSystem will be unable to interact with WebGL by rendering viewports, creating graphics and textures, etc. By default, this function invokes ToolAdmin.exceptionHandler with a brief message describing what occurred. An application can override this behavior as follows: RenderSystem.contextLossHandler = (): Promise<any> => { // your implementation here. } contextLossHandler(): Promise<any> note Context loss is reported by the browser some short time after it has occurred. It is not possible to determine the specific cause. see TileAdmin.gpuMemoryLimit to limit the amount of GPU memory consumed thereby reducing the likelihood of context loss. see TileAdmin.totalTileContentBytes for the amount of GPU memory allocated for tile graphics. Returns - Promise<any> Defined in core/frontend/src/render/RenderSystem.ts Line 535 Last Updated: 12 June, 2024