Open vikramsubramanian opened 5 months ago
circle.cpp
, replace the dynamic allocation of radius
with a stack allocation to prevent a memory leak:
double radius = std::atof(argv[1]);
std::cout << "Area of the circle: " << areaCircle(radius) << std::endl;
double* radius = new double;
since it is no longer necessary.Makefile
, square.cpp
, or triangle.cpp
as they are not relevant to the memory leak issue in the circle
program.
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.