File: cacheout.py

package info (click to toggle)
pytables 3.10.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,228 kB
  • sloc: ansic: 82,212; python: 65,296; cpp: 753; sh: 394; makefile: 100
file content (13 lines) | stat: -rw-r--r-- 313 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
# Program to clean out the filesystem cache
import numpy as np

a = np.arange(1000 * 100 * 125, dtype="f8")  # 100 MB of RAM
b = a * 3  # Another 100 MB
# delete the reference to the booked memory
del a
del b

# Do a loop to fully recharge the python interpreter
j = 2
for i in range(1000 * 1000):
    j += i * 2