Memory leak on python startup in Mac OS terminal

I just ran a python program in a Mac OS terminal and there is an unusual memory leak.

The program is simple:

for i in xrange (1,000,000,000, 2,000,000,000, 10):
  i2 = i * i
  print i, i2, str (i2) [:: 2]
  if str (i2) [:: 2] == '1234567890':
    break

When the program is running, it consumes more and more memory until it uses all my memory. When I exit the program, my Terminal.app still consumes a lot of memory, so I assume this is an error in Terminal.app?

Does anyone have a similar experience?

+2
source share
2 answers

; . Terminal.app, , , ( ). , , Terminal → Preferences → Settings - , Unlimited.

+14

Python, . . Python , 3,5 .

, , , . , - , " ".

+5

All Articles