Method and apparatus for reducing garbage collection time of golang language system
A language system and garbage technology, applied in the computer field, can solve the problems of system inaccessibility request response, reduced system friendliness, long GC pause time, etc., to reduce garbage collection time, reduce GC pause time, and improve release efficiency Effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0052] refer to figure 1 , which shows a schematic flowchart of a method for reducing the garbage collection time of the golang language system according to an embodiment of the present invention. The method may specifically include:
[0053] Step 110, allocate a continuous memory space for each hash bucket in the hash table;
[0054] In the embodiment of the present invention, the server system is constructed in golang language.
[0055] Then, for various data in the system, if a hash table needs to be used, the embodiment of the present invention does not implement the original logic of storing elements in the hash table in the form of a map in the golang language. Then execute the logic of step 110 of the present invention.
[0056] In the embodiment of the present invention, when storing the elements in the hash table, each element can be allocated to each bucket (hash bucket), so one bucket can record one or more elements correspondingly. When the number of elements is...
Embodiment 2
[0074] refer to figure 2 , which shows a schematic flowchart of a method for reducing the garbage collection time of the golang language system according to an embodiment of the present invention. The method may specifically include:
[0075] Step 210, for each hash bucket of the hash table, allocate a continuous memory space for the hash bucket through slice slicing;
[0076] In the embodiment of the present invention, the server system is constructed in golang language.
[0077] Then, for various data in the system, if a hash table needs to be used, the embodiment of the present invention does not implement the original logic of storing elements in the hash table in the form of a map in the golang language. Then execute the logic of step 110 of the present invention.
[0078] In the embodiment of the present invention, when storing the elements in the hash table, each element can be allocated to each bucket (hash bucket), so one bucket can record one or more elements corr...
Embodiment 3
[0109] refer to image 3 , which shows a schematic structural diagram of a device for reducing the garbage collection time of the golang language system according to an embodiment of the present invention. The device may specifically include:
[0110] The continuous space allocation module 310 is adapted to allocate a continuous memory space for each hash bucket in the hash table;
[0111] The element storage module 320 is adapted to store each element corresponding to the hash bucket in the continuous memory space;
[0112] The recycling module 330 is adapted to release each element in each hash bucket once when performing garbage collection on the hash table.
[0113] Preferably, the continuous space allocation module includes:
[0114] The pointer storage submodule is adapted to generate an object for each hash bucket of the hash table, and store element pointers in the hash bucket;
[0115] The space allocation submodule is suitable for allocating a continuous memory sp...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


