How do I clear the memory to avoid overcharging?

-3

As you read the HTML of the site, delete what is before. If there is any clear screen in Python.

import mechanize

response = mechanize.urlopen("https://www.exemplo.com")
m = 0
linha = ''
if (m < 100):
  for n in response.read():
    m += 1
    linha += n
    if (n == '\n'):
      print(linha)
      linha = ''
    
asked by anonymous 03.11.2018 / 23:38

1 answer

1

Python is a language that manages its memory automatically so it does not have to do anything, the memory is released when it is no longer needed. In such a case consumption is small.

In any case, if you are running on a web server even if it is not automatic and it would not make any difference because of the fleeting feature of web scripts .

And it would not make sense to clear the screen to free up memory, one thing has nothing to do with another.

    
04.11.2018 / 00:20