# Optimize Get\["..."\] and RAM usage?

**URL:** <https://community.wolfram.com/t/optimize-get-and-ram-usage/11656>\
**Category:** Questions\
**Tags:** mathematica, external-interfaces, tuning-and-debugging\
**Created:** [December 9, 2017, 12:27pm UTC](https://community.wolfram.com/t/optimize-get-and-ram-usage/11656 "2017-12-09T12:27:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![markusthuermann](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@markusthuermann](https://community.wolfram.com/u/markusthuermann)\
**Post date:** [December 9, 2017, 12:27pm UTC](https://community.wolfram.com/t/optimize-get-and-ram-usage/11656/1 "2017-12-09T12:27:50Z")

</div>

Hello everybody,  
I have a little issue with my RAM during a Do loop. Within this do loop I use Get to open a file and thereafter to manipulate it. The memory used is increased by 120 every time the loop runs. This is not much but since I run the loop for several thousand times this small value accumulates. I could pin it down to the Get function and I have created a minimal example (see below) with all RAM tricks that I know of (although I assume that some of them are - in this case - not even necessary). Does anybody know what to do?

```
Unprotect[Out];
Unprotect[In];
$HistoryLength = 0;

Do[
  Get[stringValueOfTheFile];
  ClearSystemCache[];
  Clear[In];
  Clear[Out];
  Print[MemoryInUse[]];
  , {i, 1, 100}];

```

Thanks in advance  
Markus
