Memory Usage is high in C++ implementation

Yesterday I solved delete the middle node of a linked-list question. I implemented the same algorithm in C++ and python, but the results surprised me, here's the result of python code:
image
and the result of C++ code:
image
As you can see, C++ code memory usage is high than the code written in python. I'm leaving both implementations:
python
image

C++
image

Why is the C++ implementation using so much memory?
(IMHO: I think the problem is with tests, test code may not release used memory)

P.S: sorry my english is bad...

Comments (2)