Python memory management

Source: Internet
Author: User

Python object three elements: Identity (value): Address to memory, non-modifiable type (type): Non-modifiable value (value): mutable: You can modify immutable: Cannot modify reference count when reference count is 0 GC is really going to reclaim the allocated memory>>>deff (): ...Pass... >>>ID (f)139655884671288>>> fa=F>>>ID (FA)139655884671288>>>delFA>>>delFID () returns the memory address of the object used to determine whether the same memory object is the same as an integral easing pool (0-1000)  1. For a certain range of integers, Python is allocated in memory in advance2. You can modify the scope of the buffer pool by modifying the source code to recompile python3. The integral type will not be recycled at the same address:>>> a=1>>> b=1>>>ID (a)19419960>>>ID (b)19419960class object is not in an address>>>classA: ...Pass... >>> c=A ()>>> d=A ()>>>ID (c)140100598572888>>>ID (d)140100598572960Is statement: Used to determine if two variables are pointing to the same stored object

Python memory management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.