CN109582595B - Memory management method, device, server and storage medium - Google Patents

Memory management method, device, server and storage medium Download PDF

Info

Publication number
CN109582595B
CN109582595B CN201811519134.9A CN201811519134A CN109582595B CN 109582595 B CN109582595 B CN 109582595B CN 201811519134 A CN201811519134 A CN 201811519134A CN 109582595 B CN109582595 B CN 109582595B
Authority
CN
China
Prior art keywords
memory
instantiation
memory structure
packet
database system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811519134.9A
Other languages
Chinese (zh)
Other versions
CN109582595A (en
Inventor
刘静
郭琰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Dameng Database Co Ltd
Original Assignee
Shanghai Dameng Database Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Dameng Database Co Ltd filed Critical Shanghai Dameng Database Co Ltd
Priority to CN201811519134.9A priority Critical patent/CN109582595B/en
Publication of CN109582595A publication Critical patent/CN109582595A/en
Application granted granted Critical
Publication of CN109582595B publication Critical patent/CN109582595B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory

Abstract

The invention discloses a memory management method, a memory management device, a server and a storage medium. The method comprises the following steps: and traversing a memory area corresponding to the database system, wherein the memory area is used for storing instantiation objects in the session in the database system, and when the database system is detected to be idle and the instantiation objects in the memory area are not in the packet corresponding to the session, releasing the memory space occupied by the corresponding instantiation objects. According to the technical scheme, the reference of the instantiation objects is counted only when the database system is idle, and when the database system is idle and the instantiation objects are not in the packets of the corresponding sessions, the memory space occupied by the instantiation objects is released, so that the counting of the instantiation objects is not needed in each time period, and the burden of system operation is reduced.

Description

Memory management method, device, server and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computer data, in particular to a memory management method, a memory management device, a server and a storage medium.
Background
Classes and objects are a combination of two computer languages carried by a computer. The class is an abstraction of things with common characteristics in real life, is the basis for realizing information encapsulation by object-oriented programming, is an abstraction of an object, and is generally declared in Java by using a keyword class. An object is a variable having a class type, is an instance of a class, and an instantiation of a class creates an object.
The instantiation objects of the class are stored in the memory, i.e. occupy a certain memory space. The traditional memory management method of the instantiation object of the class is carried out by the reference count of the instantiation object, namely when one instantiation object is referenced once, the reference count is increased by 1, when one reference of the instantiation object is invalid, the reference count is decreased by 1, and when the reference count is decreased to 0, the memory occupied by the instantiation object can be released. The method counts the instantiated objects in each time interval, and each reference of each instantiated object needs to calculate the reference count value, so that the complexity of the program and the running load of the system are increased.
Disclosure of Invention
Embodiments of the present invention provide a memory management method, an apparatus, a server, and a storage medium, which only perform statistics on reference of an instantiated object and release of a memory when a system is idle, thereby reducing a system load.
In a first aspect, an embodiment of the present invention provides a memory management method, including:
traversing a memory area corresponding to a database system, wherein the memory area is used for storing instantiation objects in a session in the database system;
and releasing the memory space occupied by the corresponding instantiation object when the database system is detected to be idle and the instantiation object in the memory area is not in the packet of the corresponding session.
In a second aspect, an embodiment of the present invention further provides a memory management device, where the memory management device includes:
the system comprises a traversing module, a storage module and a processing module, wherein the traversing module is used for traversing a memory area corresponding to a database system, and the memory area is used for storing instantiation objects in a session in the database system;
and the release module is used for releasing the memory space occupied by the corresponding instantiation object when the database system is idle and the instantiation object in the memory area is not in the packet of the corresponding session.
In a third aspect, an embodiment of the present invention further provides a server, including:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the memory management method according to the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the memory management method according to the first aspect.
The embodiment of the invention provides a memory management method, a memory management device, a server and a storage medium, wherein a memory area corresponding to a database system is traversed, the memory area is used for storing an instantiation object in a session in the database system, when the database system is detected to be idle and the instantiation object in the memory area is not in a packet corresponding to the session, the memory space occupied by the corresponding instantiation object is released, the reference of the instantiation object is counted only when the database system is idle, and when the database system is idle and the instantiation object is not in the packet corresponding to the session, the memory space occupied by the instantiation object is released, so that the counting of the instantiation object is not needed in each time period, and the burden of system operation is reduced.
Drawings
Fig. 1 is a flowchart of a memory management method according to an embodiment of the present invention;
fig. 2 is a flowchart of a memory management method according to a second embodiment of the present invention;
FIG. 3 is a diagram illustrating the execution of memory space release;
fig. 4 is a structural diagram of a memory management device according to a third embodiment of the present invention;
fig. 5 is a structural diagram of a server according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a memory management method according to an embodiment of the present invention, where the method may be executed by a memory management device, and the memory management device is integrated in a server, and specifically, the method includes the following steps:
and S110, traversing the memory area corresponding to the database system.
The memory area is used for storing instantiation objects in sessions in the database system. Specifically, a user can create a session when logging in the database system, and the memory area is a specific area created based on the session and used for storing an instantiation object, and can be created when the session is established or created when the session first creates an instantiation object. In object-oriented programming, a process of creating an object by using a class is generally called instantiation, the class is an abstraction of a kind of things having common characteristics in real life, and is a basis for realizing information encapsulation by object-oriented programming, the essence of the class is a data type, which is similar to basic types such as int, char and the like, and the difference is that the class is a complex data type, the essence of the class is a type, and not data, and the class cannot be directly operated, and only when the class is instantiated into the object, the class can be operated, and the instance of the class is called the object. An object, i.e. an object created by a class, is instantiated, specifically, in Java, a class is declared by a keyword class, for example, when a class is defined, it can be represented as class a, where a represents the name of the class. When creating an object according to a class, a keyword new states that a class a object a ═ new class a () indicates that an object a of class a is created, for example, Date ═ new Date (), and indicates that an object of a Date is created using a Date class.
In practical application, a memory area is created for each session, and is used to store instantiation objects of all classes in the current session, for example, a memory area 1 is created based on session 1, then the memory area 1 is used to store instantiation objects of all classes in session 1, and traversing the memory area corresponding to the database system is to traverse the instantiation objects in all memory areas.
S120, when the database system is detected to be idle and the instantiation objects in the memory area are not in the packet of the corresponding session, releasing the memory space occupied by the corresponding instantiation objects.
Specifically, there are two cases of instantiation of a class in a database, one of which is used in an SQL (Structured Query Language) statement block, a stored procedure or a stored function, in which the class is instantiated in the SQL statement block, the stored procedure or the stored function, and a scope of an instantiation object of the class is only in the SQL statement block, the stored procedure or the stored function, and when the instantiation object of the class is released when the execution of the scope is finished, the instantiation object of the class is created again when the same SQL statement block, stored procedure or stored function is executed next time, wherein the scope is used to limit a range available for the instantiation object, and the scope of the instantiation object is usually in a nearest statement block in which the scope is located. In this case, if the database system is in a non-idle state, i.e., there is a user executing an SQL statement that executes an SQL statement block, a stored procedure, or a stored function that creates an instantiation object of a class, there is a possibility that the instantiation object in use is released by mistake.
The other is that the class is used in a package, the package references an instantiation object of the class when being created, the class does not need to be re-instantiated to obtain a needed instantiation object when a method in the package is called, and the instantiation object of the class may need to be continuously used in the using process of the subsequent package. Where a package is registered on a session in which the package is created, the package functions similarly to a class, except that the class to be used when the package is created is instantiated and does not need to be instantiated when used. It is understood that there may be packages on some sessions or no packages, and if there is a package on the current session and a class is used in the package, it indicates that there is an instantiation object referenced in the package, in which case the instantiation object referenced in the package should not be released.
Based on the above two cases, in order to avoid the instantiation objects being released during the use process and provide convenience for using the instantiation objects of the class continuously in the use process of the subsequent package, the embodiment counts the instantiation objects in the memory area only when the database system is in the idle state, if the instantiation objects in the memory area are not referenced by the package on the session, that is, not in the package corresponding to the session, the corresponding instantiation objects are released, and if the instantiation objects in the memory area are referenced by the package on the session, the part of the instantiation objects is reserved and not released. When the SQL statement is not executed in the database system, the database system is in an idle state.
The embodiment of the invention provides a memory management method, which includes traversing a memory area corresponding to a database system, wherein the memory area is used for storing instantiated objects in a session in the database system, detecting that the database system is idle and the instantiated objects in the memory area are not in a packet corresponding to the session, releasing the memory space occupied by the corresponding instantiated objects, counting the references of the instantiated objects only when the database system is idle, and releasing the memory space occupied by the instantiated objects when the database system is idle and the instantiated objects are not in the packet corresponding to the session, so that the counting of the instantiated objects is not needed in each time period, and the burden of system operation is reduced.
Example two
Fig. 2 is a flowchart of a memory management method according to a second embodiment of the present invention, which is embodied on the basis of the second embodiment, and specifically, the method includes the following steps:
s210, traversing an instantiation object registration array in a memory area corresponding to the database system.
The instantiation object registration array is used for storing the memory structure address of the instantiation object in the corresponding memory area. Specifically, when the memory area is created, an instantiation object registration array may be created at the same time, and the instantiation object registration array corresponds to the memory area and is stored in the corresponding memory area. The memory structure of the instantiation object is used for storing the instantiation object and information such as ID, description information and data of the class corresponding to the instantiation object, and the instantiation object corresponds to the memory structure of the instantiation object. Traversing the instantiation object registration array in the memory area corresponding to the database system, namely traversing the memory structure address stored in the instance object registration array, and finding the memory structure corresponding to the memory structure address according to the memory structure address, namely the instantiation object.
S220, acquiring a corresponding memory structure according to the memory structure address recorded in the instantiation object registration array, wherein the memory structure corresponds to the memory structure address.
The memory structure is used for storing instantiation objects in the corresponding memory area. The memory structure address, the memory structure and the instantiation object have a corresponding relation, the corresponding memory structure can be found according to the memory structure address, and then the instantiation object in the memory structure can be found, so that the corresponding instantiation object can be conveniently found, and time is saved.
And S230, marking the memory structure as a first mark.
The first flag indicates that the memory space occupied by the instantiation object corresponding to the memory structure can be released, and if the memory structure has the first flag, the form of the first flag may be set according to the actual situation, for example, the first flag may be set to 0. Specifically, in order to determine which instantiated objects occupy a memory space that can be released and which can not be released, initially, a corresponding memory structure is searched according to a memory structure address, and all the searched memory structures are marked as first marks. It is to be understood that the instantiation object corresponds to a memory structure, and that marking a memory structure is equivalent to marking an instantiation object.
And S240, traversing a packet information linked list on the session in the database system.
And the packet information linked list is used for storing the memory structure address of the packet on the session. Specifically, the packet in the database system is registered in the session for creating the packet, the specific registration mode can be set according to the actual situation, and the packet in the database system is set to be registered in the corresponding session in a mode of a packet information linked list in the embodiment. Similar to the instantiated object register array, the packet information linked list is used to store the memory structure address of the packet, and traversing the packet information linked list is the traversing of the memory structure address.
And S250, acquiring a memory structure corresponding to the packet according to the memory structure address of the packet.
Similar to obtaining the memory structure of the instantiation object, the memory structure of the corresponding packet can be found according to the memory structure address of the packet stored in the packet information linked list. In order to further determine which instantiation objects cannot be released, after obtaining the memory structure corresponding to the packet according to the memory structure address of the packet, the method further includes:
if the object quoted in the memory structure corresponding to the packet is an instantiated object, acquiring the memory structure of the instantiated object corresponding to the object according to the address of the object;
and modifying the first mark of the memory structure of the instantiation object into a second mark.
Specifically, similar to the memory structure of the instantiation object, the memory structure of the packet stores information such as the variables and methods of the packet, the ID, description information, and data of the packet, and according to the description information in the memory structure of the packet, if a variable or a variable in a method is an instantiation object, acquiring the memory structure of the instantiation object corresponding to the variable according to the address of the variable, since initially, the memory structures of all instantiated objects are marked with the first marker, therefore, a first flag exists in the memory structure corresponding to the instantiation object found according to the description information in the memory structure of the packet, in order to avoid being released by mistake, the first mark in the memory structure of the part of the instantiation object is modified into a second mark, the second flag may also be set according to actual conditions, and for example, may be set to 1 to distinguish from the first flag 0.
It should be noted that, classes in the database system may be nested, so that the instantiated object referred to in the package needs to be further analyzed, and if other classes are also referred to in the instantiated object, the first flag of the memory structure corresponding to all instantiated objects referred to by each layer needs to be modified to the second flag.
S260, if the database system is idle and the instantiation objects in the memory area are not in the memory structure corresponding to the packet, releasing the memory space occupied by the corresponding instantiation objects.
To describe the process of releasing the memory space specifically, S260 is embodied as:
s2601, traversing the instantiation object registration array, and acquiring the memory structure of the corresponding instantiation object according to the memory structure address recorded in the instantiation object registration array.
After the marks of the memory structures corresponding to the instantiation objects are modified, traversing each instantiation object registration array, searching the corresponding memory structures according to the memory structure addresses recorded in the instantiation object registration array, if the marks in the memory structures are first marks 0, releasing the memory space occupied by the instantiation objects corresponding to the memory structures, and if the marks in the memory structures are second marks 1, reserving the memory space occupied by the instantiation objects corresponding to the memory structures without releasing, thereby providing convenience for the continuous use of the instantiation objects in the use process of subsequent packets.
S2602, if the mark of the memory structure is the first mark, releasing the memory space occupied by the instantiation object corresponding to the memory structure.
Specifically, after the memory space occupied by the instantiation object corresponding to the corresponding memory structure is released, the corresponding memory structure address in the corresponding instantiation object registration array needs to be deleted, so as to store the addresses of other memory structures. It should be noted that, when a session is released, all instantiation objects in the memory area corresponding to the session may be directly released.
Exemplarily, referring to fig. 3, fig. 3 is a schematic diagram illustrating execution of memory space release, where fig. 3 takes three sessions as an example, each session corresponds to one memory region, each memory region is provided with an instantiation object registration array, and packets are registered on session 1 and session 3. Specifically, when the database system is idle, memory areas on all sessions are traversed, memory structures corresponding to instantiated objects in the memory areas are all marked as first marks, then packet information linked lists on all sessions are traversed, instantiated objects quoted in packets are determined, the first marks of the memory structures corresponding to the instantiated objects are modified into second marks, then all instantiated object register arrays are traversed, corresponding memory structures are searched according to memory structure addresses recorded in the instantiated object register arrays, and memory space occupied by the instantiated objects corresponding to the memory structures with the first marks is released.
On the basis of the above embodiment, when the database system is in an idle state, searching for a corresponding memory structure according to a memory structure address stored in an instantiation object registration array, and marking the memory structure as a first mark, then searching for a memory structure of a corresponding packet according to a memory structure address of a packet stored in a packet information linked list, and further searching for a memory structure of a corresponding instantiation object according to description information in the memory structure of the packet, modifying the first mark into a second mark, and releasing a memory space occupied by the instantiation object corresponding to the memory structure marked with the first mark, thereby avoiding a false release of the instantiation object, and providing convenience for continuing to use the instantiation object in a subsequent packet use process.
EXAMPLE III
Fig. 4 is a structural diagram of a memory management device according to a third embodiment of the present invention, where the device can execute the memory management method according to the third embodiment, specifically, the device includes:
a traversing module 310, configured to traverse a memory area corresponding to a database system, where the memory area is used to store an instantiation object in a session in the database system;
a releasing module 320, configured to release the memory space occupied by the instantiation object if it is detected that the database system is idle and the instantiation object in the memory area is not in the packet of the corresponding session.
The third embodiment of the present invention provides a memory management device, where a memory area corresponding to a database system is traversed, where the memory area is used to store an instantiated object in a session in the database system, and when it is detected that the database system is idle and the instantiated object in the memory area is not in a packet corresponding to the session, a memory space occupied by the instantiated object is released, and only when the database system is idle, reference of the instantiated object is counted.
On the basis of the above embodiment, the traversing module 310 includes:
the first traversal unit is used for traversing an instantiation object registration array in a memory area corresponding to the database system, and the instantiation object registration array is used for storing the memory structure address of the instantiation object in the corresponding memory area;
a first obtaining unit, configured to obtain a corresponding memory structure according to a memory structure address recorded in the instantiation object registration array, where the memory structure corresponds to the memory structure address, and the memory structure is used to store an instantiation object in a corresponding memory area;
and the marking unit is used for marking the memory structure as a first mark.
On the basis of the above embodiment, the releasing module 320 includes:
the second traversal unit is used for traversing a packet information linked list on a session in the database system, and the packet information linked list is used for storing the memory structure address of the packet on the session;
a second obtaining unit, configured to obtain, according to the memory structure address of the packet, a memory structure corresponding to the packet;
and the releasing unit is used for releasing the memory space occupied by the corresponding instantiation object if the database system is idle and the instantiation object in the memory area is not in the memory structure corresponding to the packet.
On the basis of the above embodiment, the releasing module 320 further includes:
a third obtaining unit, configured to, after obtaining the memory structure corresponding to the packet according to the memory structure address of the packet, if an object referenced in the memory structure corresponding to the packet is an instantiated object, obtain, according to the address of the object, the memory structure of the instantiated object corresponding to the object;
and the modifying unit is used for modifying the first mark of the memory structure of the instantiation object into a second mark.
On the basis of the above embodiment, the releasing unit includes:
the acquiring subunit is used for traversing the instantiation object registration array and acquiring the memory structure of the corresponding instantiation object according to the memory structure address recorded in the instantiation object registration array;
and the releasing subunit is configured to release the memory space occupied by the instantiation object corresponding to the memory structure if the mark of the memory structure is the first mark.
The memory management device provided by the third embodiment of the present invention and the memory management method provided by the foregoing embodiments belong to the same inventive concept, and the technical details that are not described in detail in the present embodiment can be referred to the foregoing embodiments, and the present embodiment has the same beneficial effects as the memory management method.
Example four
Fig. 5 is a structural diagram of a server according to a fourth embodiment of the present invention, specifically, referring to fig. 5, the server includes: the number of the processors 410 in the server can be one or more, one processor 410 is taken as an example in fig. 5, the processors 410, the memory 420, the input devices 430 and the output devices 440 in the server can be connected by a bus or in other ways, and the processor 410, the memory 420, the input devices 430 and the output devices 440 in fig. 5 are taken as an example of being connected by a bus.
The memory 420 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the memory management method in the embodiment of the present invention. The processor 410 executes various functional applications of the server and data processing by executing software programs, instructions and modules stored in the memory 420, that is, implements the memory management method of the above-described embodiment.
The memory 420 mainly includes a program storage area and a data storage area, wherein the program storage area can store an operating system and an application program required by at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 420 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, memory 420 may further include memory located remotely from processor 410, which may be connected to a server over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 430 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the server. The output device 440 may include a display device such as a display screen, and an audio device such as a speaker and a buzzer.
The server provided by the fourth embodiment of the present invention and the memory management method provided by the foregoing embodiment belong to the same inventive concept, and the technical details that are not described in detail in this embodiment may be referred to the foregoing embodiment.
EXAMPLE five
Fifth, an embodiment of the present invention further provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a memory management method according to any embodiment of the present invention.
Of course, the storage medium provided in the embodiments of the present invention includes computer-executable instructions, and the computer-executable instructions are not limited to the operations in the memory management method described above, and may also perform related operations in the memory management method provided in any embodiment of the present invention, and have corresponding functions and advantages.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a robot, a personal computer, a server, or a network device) to execute the Memory management method according to the embodiments of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (5)

1. A memory management method, comprising:
traversing a memory area corresponding to a database system, wherein the memory area is used for storing instantiation objects in a session in the database system;
when the database system is detected to be idle and the instantiation objects in the memory area are not in the packet corresponding to the session, releasing the memory space occupied by the corresponding instantiation objects;
the memory area corresponding to the traversal database system comprises:
traversing instantiation object register arrays in memory areas corresponding to the database system, wherein the instantiation object register arrays are used for storing memory structure addresses of instantiation objects in the corresponding memory areas;
acquiring a corresponding memory structure according to the memory structure address recorded in the instantiation object registration array, wherein the memory structure corresponds to the memory structure address, and the memory structure is used for storing the instantiation objects in the corresponding memory area;
marking the memory structure as a first mark;
if the database system is detected to be idle and the instantiation object in the memory area is not in the packet corresponding to the session, releasing the memory space occupied by the corresponding instantiation object, including:
traversing a packet information linked list on a session in the database system, wherein the packet information linked list is used for storing the memory structure address of the packet on the session;
acquiring a memory structure corresponding to the packet according to the memory structure address of the packet;
if the database system is idle and the instantiation object in the memory area is not in the memory structure corresponding to the packet, releasing the memory space occupied by the corresponding instantiation object;
after the obtaining the memory structure corresponding to the packet according to the memory structure address of the packet, the method further includes:
if the object quoted in the memory structure corresponding to the packet is an instantiated object, acquiring the memory structure of the instantiated object corresponding to the object according to the address of the object;
modifying the first mark of the memory structure of the instantiation object into a second mark;
wherein the first indicia is indicative of being releasable and the second indicia is indicative of not being released.
2. The method according to claim 1, wherein if the database system is idle and the instantiation object in the memory area is not in the memory structure corresponding to the packet, releasing the memory space occupied by the corresponding instantiation object comprises:
traversing the instantiation object registration array, and acquiring the memory structure of the corresponding instantiation object according to the memory structure address recorded in the instantiation object registration array;
and if the mark of the memory structure is the first mark, releasing the memory space occupied by the instantiation object corresponding to the memory structure.
3. A memory management device, comprising:
the system comprises a traversing module, a storage module and a processing module, wherein the traversing module is used for traversing a memory area corresponding to a database system, and the memory area is used for storing instantiation objects in a session in the database system;
a release module, configured to release a memory space occupied by a corresponding instantiation object when the database system is idle and the instantiation object in the memory area is not in a packet of a corresponding session;
the traversal module comprises:
the first traversal unit is used for traversing an instantiation object registration array in a memory area corresponding to the database system, and the instantiation object registration array is used for storing the memory structure address of the instantiation object in the corresponding memory area;
a first obtaining unit, configured to obtain a corresponding memory structure according to a memory structure address recorded in the instantiation object registration array, where the memory structure corresponds to the memory structure address, and the memory structure is used to store an instantiation object in a corresponding memory area;
the marking unit is used for marking the memory structure as a first mark;
the release module includes:
the second traversal unit is used for traversing a packet information linked list on a session in the database system, and the packet information linked list is used for storing the memory structure address of the packet on the session;
a second obtaining unit, configured to obtain, according to the memory structure address of the packet, a memory structure corresponding to the packet;
a releasing unit, configured to release a memory space occupied by the instantiation object if the database system is idle and the instantiation object in the memory area is not in the memory structure corresponding to the packet;
the release module further comprises:
a third obtaining unit, configured to, after obtaining the memory structure corresponding to the packet according to the memory structure address of the packet, if an object referenced in the memory structure corresponding to the packet is an instantiated object, obtain, according to the address of the object, the memory structure of the instantiated object corresponding to the object;
the modifying unit is used for modifying the first mark of the memory structure of the instantiation object into a second mark;
wherein the first indicia is indicative of being releasable and the second indicia is indicative of not being released.
4. A server, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the memory management method of any one of claims 1-2.
5. A storage medium on which a computer program is stored, which program, when being executed by a processor, carries out the memory management method according to any one of claims 1-2.
CN201811519134.9A 2018-12-12 2018-12-12 Memory management method, device, server and storage medium Active CN109582595B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811519134.9A CN109582595B (en) 2018-12-12 2018-12-12 Memory management method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811519134.9A CN109582595B (en) 2018-12-12 2018-12-12 Memory management method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN109582595A CN109582595A (en) 2019-04-05
CN109582595B true CN109582595B (en) 2021-08-17

Family

ID=65928277

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811519134.9A Active CN109582595B (en) 2018-12-12 2018-12-12 Memory management method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN109582595B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110231994B (en) * 2019-06-20 2024-03-12 深圳市腾讯网域计算机网络有限公司 Memory analysis method, memory analysis device and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5455951A (en) * 1993-07-19 1995-10-03 Taligent, Inc. Method and apparatus for running an object-oriented program on a host computer with a procedural operating system
US5802523A (en) * 1996-06-21 1998-09-01 Oracle Corporation Method and apparatus for reducing the memory required to store bind variable descriptors in a database
JP2006101142A (en) * 2004-09-29 2006-04-13 Brother Ind Ltd Network control device, network control method, and network control program

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6298070B1 (en) * 1998-05-07 2001-10-02 International Business Machines Corporation Packet training with an adjustable optimum number of packets
CN100422932C (en) * 2002-12-31 2008-10-01 上海科泰世纪科技有限公司 Processing method for self discribing data object
US20040181510A1 (en) * 2003-01-16 2004-09-16 Jardin Cary A. System and method for cooperative database acceleration
US8266125B2 (en) * 2009-10-01 2012-09-11 Starcounter Ab Systems and methods for managing databases
US9268621B2 (en) * 2011-11-02 2016-02-23 Red Hat, Inc. Reducing latency in multicast traffic reception
CN103365929B (en) * 2012-04-10 2016-09-28 阿里巴巴集团控股有限公司 The management method of a kind of data base connection and system
CN107291598B (en) * 2017-08-07 2018-07-06 腾讯科技(深圳)有限公司 Monitoring method, monitoring device, monitoring device and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5455951A (en) * 1993-07-19 1995-10-03 Taligent, Inc. Method and apparatus for running an object-oriented program on a host computer with a procedural operating system
US5802523A (en) * 1996-06-21 1998-09-01 Oracle Corporation Method and apparatus for reducing the memory required to store bind variable descriptors in a database
JP2006101142A (en) * 2004-09-29 2006-04-13 Brother Ind Ltd Network control device, network control method, and network control program

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Bug traces: identifying and downsizing packet traces with failures triggered in networking devices;Ying-dar Lin等;《IEEE Communications Magazine》;20140501;第52卷(第4期);第112-119页 *
基于对象映射的数据访问服务;毛建强等;《指挥信息系统与技术》;20120828;第3卷(第4期);第59-61页 *

Also Published As

Publication number Publication date
CN109582595A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
US5291593A (en) System for persistent and delayed allocation object reference in an object oriented environment
CN109144994A (en) Index updating method, system and relevant apparatus
US10656981B2 (en) Anomaly detection using sequences of system calls
CN110750315B (en) Class loading method, device, equipment and storage medium in Android system
US20150039648A1 (en) System and a method for reasoning and running continuous queries over data streams
CN111737295B (en) Database cursor query method, device, equipment and storage medium
CN109582595B (en) Memory management method, device, server and storage medium
CN111309753B (en) Optimization method, device, equipment and storage medium of structured query statement
CN107330031B (en) Data storage method and device and electronic equipment
US10521327B2 (en) Non-coupled software lockstep
US20230308933A1 (en) Data transmission method, related network node and storage medium
CN105183668B (en) Cache flush method and device
CN114924733A (en) Form dependency relationship management and form accurate rendering method and system
CN107526690B (en) Method and device for clearing cache
CN115002028A (en) Message processing method, device and medium
CN109062647B (en) Data sharing method, device and equipment of active window and storage medium
CN112291212A (en) Static rule management method and device, electronic equipment and storage medium
US7996401B2 (en) Inserting new transactions into a transaction stream
CN110032406B (en) Message-based view loading method, device, equipment and storage medium
CN115658430A (en) Event monitoring processing method and device, electronic equipment and storage medium
CN112540897B (en) Database monitoring method, device, server and medium
CN111124923B (en) Running state query method and device, server equipment and storage medium
CN104360954B (en) A kind of statistical method and system for having applied for memory block
CN111782667B (en) MongoDB updated data driving method, system and storage medium
CN113194075B (en) Access request processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant