Memory Leak caused by VNDocumentViewController

I'm using VNDocumentViewController to scan some documents which is working fine. But not infrequently, the app becomes slow after dismissing the VNDocumentViewController. There is no VNDocumentViewController instance allocated, but according to the allocations gathered by instruments, there is a ICDocCamViewController still living and using between 200 and 300 MB.

I guess that ICDocCamViewController is an internal component of VNDocumentViewController. Are there any known issues? Unfortunately, I do not see any way to free ICDocCamViewController.

 281.37 MB      93.1%	104708	 	start_wqthread
 281.37 MB      93.1%	104708	 	 _pthread_wqthread
 256.04 MB      84.7%	42747	 	  _dispatch_workloop_worker_thread
 256.03 MB      84.7%	42564	 	   _dispatch_lane_invoke
 256.03 MB      84.7%	42564	 	    _dispatch_lane_serial_drain
 249.91 MB      82.7%	22258	 	     _dispatch_client_callout
 237.01 MB      78.4%	8562	 	      _dispatch_call_block_and_release
 236.50 MB      78.3%	3836	 	       __77-[ICDocCamViewController saveCapturedImage:metaData:rects:completionHandler:]_block_invoke_3
 236.50 MB      78.3%	3836	 	        -[ICDocCamViewController cropAndFilterImage:rects:filterType:]
 236.49 MB      78.3%	3678	 	         +[ICDocCamImageFilters filteredImage:orientation:imageFilterType:]
 236.49 MB      78.3%	3678	 	          +[ICDocCamImageFilters colorDocument:orientation:]
 236.47 MB      78.3%	3476	 	           -[CIContext(createCGImage) createCGImage:fromRect:]
 236.47 MB      78.3%	3476	 	            -[CIContext(_createCGImageInternal) _createCGImage:fromRect:format:premultiplied:colorSpace:deferred:renderCallback:]
 236.40 MB      78.2%	2096	 	             -[CIContext(CIRenderDestination) startTaskToRender:fromRect:toDestination:atPoint:error:]
 236.40 MB      78.2%	2096	 	              -[CIContext(CIRenderDestination) _startTaskToRender:toDestination:forPrepareRender:forClear:error:]
 236.40 MB      78.2%	2096	 	               CI::RenderToBitmap::render(CI::Image*, CI::Context*) const
 236.40 MB      78.2%	2096	 	                CI::image_get_bitmap(CI::Context*, CI::Image*, CGRect, CGColorSpace*, CI::Bitmap*, CI::RenderDestination const*)
 236.33 MB      78.2%	716	 	                 CI::tile_node_graph(CI::Context*, CI::RenderDestination const*, char const*, CI::Node*, CGRect const&, CI::PixelFormat, CI::swizzle_info const&, CI::TileTask* (CI::ProgramNode*, CGRect) block_pointer)
 236.33 MB      78.2%	716	 	                  CI::recursive_tile(CI::RenderTask*, CI::Context*, CI::RenderDestination const*, char const*, CI::Node*, CGRect const&, CI::PixelFormat, CI::swizzle_info const&, CI::TileTask* (CI::ProgramNode*, CGRect) block_pointer)
 236.26 MB      78.2%	212	 	                   invocation function for block in CI::image_get_bitmap(CI::Context*, CI::Image*, CGRect, CGColorSpace*, CI::Bitmap*, CI::RenderDestination const*)
 236.26 MB      78.2%	212	 	                    CI::Context::render(CI::ProgramNode*, CGRect const&)
 236.26 MB      78.2%	212	 	                     CI::Context::recursive_render(CI::TileTask*, CI::roiKey const&, CI::Node*, bool)
 236.26 MB      78.2%	211	 	                      CI::Context::recursive_render(CI::TileTask*, CI::roiKey const&, CI::Node*, bool)
 236.24 MB      78.2%	196	 	                       CI::Context::recursive_render(CI::TileTask*, CI::roiKey const&, CI::Node*, bool)
 236.23 MB      78.2%	181	 	                        CI::Context::recursive_render(CI::TileTask*, CI::roiKey const&, CI::Node*, bool)
 236.21 MB      78.2%	166	 	                         CI::Context::recursive_render(CI::TileTask*, CI::roiKey const&, CI::Node*, bool)
 236.19 MB      78.2%	151	 	                          CI::Context::recursive_render(CI::TileTask*, CI::roiKey const&, CI::Node*, bool)
  17.02 KB       0.0%	14	 	                          CI::MetalTextureManager::create_intermediate(CI::IntermediateDescriptor const&, unsigned long long, CGRect const&, unsigned long, unsigned long, bool)
    128 Bytes    0.0%	1	 	                          CI::MetalContext::render_intermediate_node(CI::TileTask*, CI::ProgramNode*, CGRect const&, CI::intermediate_t*, bool, void () block_pointer)
  17.02 KB       0.0%	14	 	                         CI::MetalTextureManager::create_intermediate(CI::IntermediateDescriptor const&, unsigned long long, CGRect const&, unsigned long, unsigned long, bool)
    128 Bytes    0.0%	1	 	                         CI::MetalContext::render_intermediate_node(CI::TileTask*, CI::ProgramNode*, CGRect const&, CI::intermediate_t*, bool, void () block_pointer)
  17.02 KB       0.0%	14	 	                        CI::MetalTextureManager::create_intermediate(CI::IntermediateDescriptor const&, unsigned long long, CGRect const&, unsigned long, unsigned long, bool)
    128 Bytes    0.0%	1	 	                        CI::MetalContext::render_intermediate_node(CI::TileTask*, CI::ProgramNode*, CGRect const&, CI::intermediate_t*, bool, void () block_pointer)
  17.02 KB       0.0%	14	 	                       CI::MetalTextureManager::create_intermediate(CI::IntermediateDescriptor const&, unsigned long long, CGRect const&, unsigned long, unsigned long, bool)
    128 Bytes    0.0%	1	 	                       CI::MetalContext::render_intermediate_node(CI::TileTask*, CI::ProgramNode*, CGRect const&, CI::intermediate_t*, bool, void () block_pointer)
    128 Bytes    0.0%	1	 	                      CI::MetalContext::render_root_node(CI::TileTask*, CI::ProgramNode*, CGRect const&, void () block_pointer, void () block_pointer)
  69.00 KB       0.0%	504	 	                   CI::gather_rois_for_program_graph(CI::Context*, char const*, CI::ProgramNode*, CGRect)
  71.72 KB       0.0%	1380	 	                 CI::prepare_initial_graph(CI::Context*, char const*, CI::Image*, CI::RenderDestination const*, CGRect, CGColorSpace*, CI::PixelFormat, CI::swizzle_info, CI::Affine const&, bool, CI::TextureDescriptor*)
  71.72 KB       0.0%	1380	 	             CI::prepare_initial_graph(CI::Context*, char const*, CI::Image*, CI::RenderDestination const*, CGRect, CGColorSpace*, CI::PixelFormat, CI::swizzle_info, CI::Affine const&, bool, CI::TextureDescriptor*)
  18.34 KB       0.0%	202	 	           -[CIPaperWash outputImage]

Replies

I have same problem, Did you solved it?