Mayil-SB-Internal-Prod / area-of-shapes

0 stars 0 forks source link

Performance reduces as time goes on and area of circle is computed several times #10

Open vikramsubramanian opened 5 months ago

vikramsubramanian commented 5 months ago

We have noticed a gradual reduction in performance and increased memory usage, particularly in scenarios where the ./circle program is called repeatedly.

Restarting the device seems to fix the problem and memory usage is low again and the system is fast but it slowly degrades over time. Not sure what is going on...

Severity: Medium - The issue does not impact the immediate functionality but can lead to long-term performance degradation.

Priority: Medium - Should be fixed in the upcoming maintenance cycle to prevent potential performance issues in production environments.

mayil-ai[bot] commented 5 months ago

Possible Solution

Code snippets to check

circle.cpp The circle.cpp file contains a memory leak due to the dynamic allocation of 'radius' without a corresponding delete, which could be causing the performance reduction and increased memory usage over time. https://github.com/Mayil-SB-Internal-Prod/area-of-shapes/blob/bc2bfb94a36dff8f8f00369dacc8a3c622c3e7ab/circle.cpp#L1-L22