Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Memory fragment allocation method and device based on shared memory

A memory fragmentation and shared memory technology, applied in the direction of memory address/allocation/relocation, etc., can solve problems affecting software system efficiency and consuming system resources, so as to improve system efficiency, increase concurrency, improve horizontal expansion capability and flexibility sexual effect

Inactive Publication Date: 2014-12-10
深圳市梦网视讯有限公司
View PDF12 Cites 8 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0008] The purpose of the embodiments of the present invention is to propose a memory fragment allocation method based on shared memory, which aims to solve the problem of multiple copies in the process of message transmission and processing in the prior art, which consumes system resources and affects the efficiency of the software 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
  • Memory fragment allocation method and device based on shared memory
  • Memory fragment allocation method and device based on shared memory
  • Memory fragment allocation method and device based on shared memory

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0032] figure 1 It is a flowchart of a memory fragment allocation method based on shared memory in a preferred embodiment of the present invention; the method includes the following steps:

[0033] S101, according to the message length L of the message to be stored, traverse the free fragment list from the beginning to the end, and find free memory fragments whose total fragment length is greater than "fragment header length + L";

[0034] Such as figure 2 Shown is a schematic diagram of the memory fragmentation structure of the preferred embodiment of the present invention;

[0035] Memory fragmentation is a certain length of storage space allocated from shared memory for read or write operations;

[0036] Memory fragmentation includes a fragment header and a fragment entity; the fragment header includes 5 fields: the total length of the fragment, the used length, the previous fragment pointer, the next fragment pointer, and the usage status; the fragment entity is the act...

Embodiment 2

[0069] Figure 5 It is a structural diagram of a device for allocating memory fragments based on shared memory in a preferred embodiment of the present invention. The devices include:

[0070] The free fragment linked list traversal module is used to traverse the free fragment linked list from the beginning to the end according to the message length L of the message to be stored, and find free memory fragments whose total fragment length is greater than "fragment header length + L";

[0071] The first judging module is used to judge whether to find free memory fragments whose total fragment length is greater than "fragment header length+L", if so, then enter the second judging module, otherwise, enter the fragment reorganization module,

[0072] The second judging module is used to judge whether the fragment total length of the free memory fragment is greater than "fragment header length+L+ fragment header length" (i.e. "L+ two fragment header lengths"), if so, then enter the...

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 memory fragment allocation method and device based on a shared memory. According to the method and device, problem that information is copied for many times in the information transmission and processing process is solved, an information buffer queue is moved from a trusted receiver to the shared memory, and an information queue building and memory fragment allocation method is disclosed on the basis of the shared memory. Copying frequency can be reduced in the information transmission and processing process, system efficiency is improved, and concurrency of a network server is improved; meanwhile, io is separated from logical processing, and lateral expansion capability and flexibility of the network server can be improved.

Description

technical field [0001] The invention relates to the field of mobile Internet memory management, in particular to a method and device for allocating memory fragments based on shared memory. Background technique [0002] IO event read and write separation means that the read operation and the write operation are not in the same thread or process. This prevents one of the operations from blocking the thread without affecting the other. [0003] The separation of io and logic processing means that the io operation thread and the worker thread are in different threads, so as to avoid mutual influence. [0004] Shared memory is a portion of physical memory shared by multiple processes. Shared memory is the fastest way to share data between processes. When a process writes data to a shared memory area, all processes sharing this memory area can immediately see the contents. [0005] The network IO read and write thread is separated from the message processing worker thread, whic...

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): G06F12/02
Inventor 熊剑
Owner 深圳市梦网视讯有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products