vtkxxxxReader memory management

My program as a service, so it needs to continuously create different vtkxxxReader instances and read in files. However, I’m currently facing two issues.

  1. Even after the use of vtkxxxxReader has ended, the memory is not completely released.
  2. When using the VTK libraries in ParaView, such as vtkMEDReader, memory usage increases with multiple calls.
void readerFile() {
    vtkNew<vtkMEDReader> m_reader;
    m_reader->SetFileName(InputFile);
    m_reader->Update();
}
 
long long getProcessMemoryInfo(pid_t pid, const std::string &key){...} // Get the current memory occupied by the process

int main()
{
    pid_t pid = getpid();
    int counter = 5;
    while (counter--) {
        std::cout << "Start RSS = "<<getProcessMemoryInfo(pid, "VmRSS")<< std::endl;
        readerFile();
        std::cout << "End RSS = "<<getProcessMemoryInfo(pid, "VmRSS")<< std::endl;
    }
    return 0;
}

After creating the reader container in VTK, passing in the file name, and calling the Update function, when the lifecycle of the container ends (while the overall process has not terminated), the memory occupied is not fully released.

I have already tried the following methods, but none of them have been effective:

  1. Adding m_reader.Reset();
  2. Switching to vtkSmartPointer
  3. Manually managing memory in the traditional C++ way:
    vtkMEDReader* m_reader = vtkMEDReader::New(); m_reader->Delete();

Do you reproduce the memory consumption with other readers like the vtkXML ones?