We have a service which is running smoothly(no memory spikes) but there is some problem in the expected results so we replaced that shallow copy to deep copy. But after replacing it with deep copy we are seeing regular memory spikes. Is it can be the reason of memory spikes?
// Shallow copy of the currentContext
const traceContext = Object.assign({}, currentContext); // Before
// Deep copy of the currentContext
let traceContext = JSON.parse(JSON.stringify(currentContext)); // Now