Fill memeory with endless loop?

globalrev skanemupp at yahoo.se
Tue May 13 14:18:31 EDT 2008


On 13 Maj, 18:59, Filip Štědronský <regn... at seznam.cz> wrote:
> On Út, kvě 13, 2008 at 06:49:33 +0200, globalrev wrote:
>
> > if i do something like
> > while 1:
> >     print "x"
>
> > will the program ever stop because it runs out of memory?
>
> No, there is no reason to run out of memory. This will simply
> make an everlasting x-printer and there is no need to store
> anything (except output buffers, terminal scrollback, etc.,
> but all of this is temporary and of limited size). In case of
> adding elements to a list, the memory usage can, of course,
> grow unlimitedly. On linux, if the process eats up too much
> memory, it gets killed. I do not know about windows, but
> they would probably crash with a BSOD or something of that
> sort.


and when the program get skiled because out of memory all this will be
deleted from the memory?

so there is no way that you can, by accident, fill your whole
harddrive and make it unusable?

and RAM-memory always get cleaned out when not used i guess?



More information about the Python-list mailing list