Tag:Memory space

  • The impact of operating system swap on the performance of redis and the solution

    Time:2021-7-14

    catalogue 1、 Operating system swap 2、 Why does redis trigger swap 3、 View redis swap 4、 Solve redis swap 1、 Operating system swap Swap is the behavior of the operating system, which means that when the memory is insufficient, the operating system takes out part of the memory data and puts it into the disk, […]

  • Storage principle of C # data type in memory

    Time:2021-6-11

    In C #, the type of variable belongs to reference type, value type, and the conversion between them is difficult to understand, which is related to the storage structure of type in memory. This paper combs the process through the relationship between memory, stack, heap, value type, reference type, and the boxing operation generated by […]

  • Data structure in C

    Time:2021-6-7

    Array Continuous memory space Fast location and search elements, strong random access, high search efficiency Known uniform element type, reduce runtime overhead Fixed length, no more elements can be added   ArrayList Continuous memory space Fast location and search elements, strong random access, high search efficiency Variable length, easy to add and delete elements Unknown […]

  • Learning notes of C + +

    Time:2021-6-7

    Quotation: it is a kind of rhetorical device, which refers to the words of famous people, or the things, things, poems, allusions, fables, idioms, proverbs, proverbs, etc. of famous people to support the author’s position, so as to prove and strengthen his theory and enrich the content of the article [1].–Wikipedia In C + +, […]

  • Easy to understand, get deep and shallow copy in Python

    Time:2021-5-5

    Deep and shallow copy in Python Before talking about deep and shallow copy, I want to talk about it firstisand==The difference between them. We can use theisand== is:Compare whether the references of two objects are the same, that is, whether their IDs are the same == : Compare whether the values of two objects are […]

  • Reference variable

    Time:2021-4-26

    Reference operator& Reference is to give an alias to a defined variable, such as int main(void) { int a = 5; int& b = a; cout << b; return 0; } The output is: 5By using the & operator and giving a nickname B to a, B can be used as a. A and B […]

  • Some common wrong usages of pointer in C language

    Time:2021-4-20

    A good pointer is like divine help. If you don’t use it well, you will complain. But most people don’t use it well, so many languages later encapsulated and shielded the pointer. For example, Java and Java do not have pointers, but pointers are used in many places, but they are not open to users. […]

  • On the effect of dictionary storing different types of variables

    Time:2021-4-19

    Recently, I’m writing a small tool, which uses a custom class and needs to instantiate the class. Because we need to get different instances according to the requirements, we decided to put them into a dictionary for easy access. In addition, because the content of instantiation may be changed later, we prepare to encapsulate the […]

  • The implementation principle of Python dictionary

    Time:2021-4-6

    The implementation principle of Python dictionary Pseudo code a = {} a[‘key1’] = 1 a[‘key2’] = 6 del a [‘key1’] Underlying implementation Python interpreter executes a = {}Python interpreter read here, for example, will give five consecutive memory space, there are five consecutive memory addresses, can put data The Python interpreter executes a [‘key1 ‘] […]

  • Copy constructor

    Time:2021-2-27

    (1) Why copy constructors? There are three ways to pass parameters to a functionOne is to transfer values, one is to transfer addresses, and the other is to transfer references.The difference between value passing and other two methods is that when the value passing method is used, it will be generated in the functionTransfer parametersThe […]

  • Cache: a lightweight cache implementation

    Time:2021-2-17

    1、 Introduction Some special data are often exposed in the system, which are stored in relational database Frequent data requests The data changes very little The data volume is slightly larger Frequent data requests indicate frequent interaction with the database, occupying session resources with the database. Moreover, the amount of data is slightly large, and […]

  • Why doesn’t Python support I + + incremental syntax and provide + + operators?

    Time:2021-2-17

    Why doesn’t Python support I + + incremental syntax and provide + + operators? In C / C + + / Java and other languages, the autoincrement or autodecrement operations of integer variables are standard configuration. They can be divided into prefix operations (+ + I and — I) and suffix operations (I + + […]