9
$\begingroup$

I was looking in the history of asked questions for similar questions, but none of the alike questions answered my problem sufficiently. So I ask nevertheless.

My system memory is leaked by simple reapeaded exporting of *jpg-graphics.

Here is a little example code to reproduce the problem:

$Version
Out: "11.1.0 for Microsoft Windows (64-bit) (March 13, 2017)"

SetDirectory[NotebookDirectory[]]

MemoryInUse[]

105896168

(*generate 100 test images in the current directory*)
Export[ToString[#] <> ".jpg", Image @ RandomReal[1, {1000, 1000}]] & /@
Range[100];

(*Memory increased dramatically after exporting:*)
MemoryInUse[]

908224456

(*Clearing memory and other methods do not work...*)
ClearSystemCache[];
Unprotect[Out]; Clear[Out];
Unprotect[In]; Clear[In];
MemoryInUse[]

908160008

Also with repeaded evaluation of the notebook, the memory increases as shown in the Windows Task-Manager:

Memory Usage Monitoring from Windows

Only quitting the kernel helps to clear the memory again.

Is this maybe a reported problem?

Why is there no other method to effectively clear the memory?

$\endgroup$
  • 1
    $\begingroup$ With version 11.2.0 on Windows 7 x64 I do not observe the described increase in MemoryInUse[] after exporting of 100 JPG files. According to the Task Manager, there is no increase too. $\endgroup$ – Alexey Popkov Oct 27 '17 at 5:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.