Unlock instant, AI-driven research and patent intelligence for your innovation.

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

Active Publication Date: 2017-03-29
BEIJING QIHOO TECH CO LTD +1
View PDF4 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] However, when the system is performing garbage collection, if there are too many objects, the release process will be very long, and the GC pause time will also be very long
Therefore, for an online system that requires a short response time in the prior art, the above-mentioned long GC pause time makes the system unable to respond to the access request in time, and also makes the user wait for a long time, reducing the friendliness of the system

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and apparatus for reducing garbage collection time of golang language system
  • Method and apparatus for reducing garbage collection time of golang language system
  • Method and apparatus for reducing garbage collection time of golang language system

Examples

Experimental program
Comparison scheme
Effect test

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...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method and an apparatus for reducing garbage collection time of a golang language system, and relates to the technical field of computers. The method comprises the steps of allocating a continuous internal memory space for each hash bucket in a hash table; storing each element corresponding to each hash bucket into the corresponding continuous internal memory space; and when garbage collection is carried out on the hash table, performing one-time releasing on each element in each hash bucket. By adoption of the method and the apparatus, the elements under the same bucket can be released in one time, so that the beneficial effects are achieved as follows: the number of released objects is greatly reduced, the releasing efficiency is improved, GC (garbage collection) pause time is reduced, and influence to an external visiting request from GC pause is reduced.

Description

technical field [0001] The invention relates to the field of computer technology, in particular to a method and device for reducing garbage collection time of a golang language system. Background technique [0002] The Golang language is an open source project developed by Google, one of its purposes is to improve the programming efficiency of developers. The Golang language syntax is flexible, concise, clear, and efficient. Its concurrency features can be easily used for multi-core processors and network development. At the same time, the flexible and novel type system can easily write modular systems. Go can be compiled quickly, has automatic garbage memory recovery, and also supports runtime reflection. Go is an efficient, statically typed system-level syntax with the dynamic typing characteristics of an interpreted language. [0003] In the prior art, when designing a system by the golang language, a GC (garbage collection, garbage collection) mechanism can be designed...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/45
Inventor 潘青
Owner BEIJING QIHOO TECH CO LTD