In React development, encountering the warning "can't perform a React state update on an unmounted component" indicates a potential issue with memory management. What is the recommended approach to resolve this problem?
A) Increase the frequency of component re-renders.
B) Utilize the 'componentDidUpdate' lifecycle method to handle state updates.
C) Cancel all subscriptions and asynchronous tasks in the 'useEffect' cleanup function.
D) Optimize the component's rendering performance using 'React.memo'.