CN103617133B - Virtual memory compression method and device in a kind of Windows systems - Google Patents

Virtual memory compression method and device in a kind of Windows systems Download PDF

Info

Publication number
CN103617133B
CN103617133B CN201310656949.2A CN201310656949A CN103617133B CN 103617133 B CN103617133 B CN 103617133B CN 201310656949 A CN201310656949 A CN 201310656949A CN 103617133 B CN103617133 B CN 103617133B
Authority
CN
China
Prior art keywords
virtual memory
data
file
memory
behavior
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
CN201310656949.2A
Other languages
Chinese (zh)
Other versions
CN103617133A (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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201310656949.2A priority Critical patent/CN103617133B/en
Publication of CN103617133A publication Critical patent/CN103617133A/en
Application granted granted Critical
Publication of CN103617133B publication Critical patent/CN103617133B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses virtual memory compression method and device in a kind of Windows systems, this method includes:Resident thread in intercepting system process writes the behavior of data by virtual memory to virtual memory file, and data are compressed, are stored in virtual memory;The behavior that resident thread reads data by virtual memory to virtual memory file is intercepted, the data that will be stored in virtual memory are decompressed, and return to system process.According to virtual memory compression method and device in the Windows systems of the present invention, can be in current process all in the case of work, when shared virtual memory is excessive, it is to avoid the time that the frequent read-write to disk is caused wastes, and then avoids the problem of system operation is slow.

Description

Virtual memory compression method and device in a kind of Windows systems
Technical field
The present invention relates to computer system optimizing technical field, and in particular to virtual memory pressure in a kind of Windows systems Compression method and device.
Background technology
, it is necessary to read file from disk to start computer system during computer booting.Under many scenes, file is not It is stored in the continuous cluster of disk, but file is generated on disk to the diverse location of whole disk by distributed and saved Fragment.For example, when the disk space of storage file is inadequate, can be produced when file or add file are deleted on disk a large amount of File fragmentation, more frequent to revising for file, the phenomenon of file fragmentation is more serious.Due to the diverse location in reading disk During file, disk contact needs to be moved to different positions, and file fragmentation can be such that disk contact frequently moves back and forth, cause file Read access time is long, therefore, and existing scheme is come by the way that the file fragmentation of a file is filled in into disk in continuous space Shorten the time that this document is read in start process, to accelerate the starting up speed of computer system.
And during computer booting, the program run in computer is both needed to perform via internal memory, if perform Program committed memory is very big or a lot, then can cause memory consumption totally.To solve to use in the problem, Windows systems Virtual memory techniques, i.e., it is even go out a part of disk space used to serve as internal memory.When internal memory exhausts, computer will be adjusted automatically Internal memory is served as with disk, to tackle the situation that system is more than actual physics internal memory to the occupancy of virtual memory.Virtual memory Technology causes application program to think that it possesses continuous available internal memory(One continuous whole address space).
The realization mechanism of virtual memory techniques in Windows systems is specially:Configuration one is virtual interior under system disk Deposit file pagefile.sys, the disk space that as virtual memory retains;, ought when the virtual memory that process takes is excessive Temporarily unwanted data are changed into virtual memory file preceding process from virtual memory;Changed to when process is read in virtual When depositing the data in file, then the data are changed in virtual memory from virtual memory file.This mechanism is extended virtually The space of internal memory, makes virtual memory not only can also utilize one in disk using actual physical memory data storage Partial spatial extension virtual memory is with data storage.But can frequently be taken considerable time to disk read-write data, so as to make The problem of running slow into computer system.
When prior art solves process occupancy a large amount of internal memories using system optimization acceleration technique, computer system operation is slow The problem of.For example computer provide some optimization accelerate function, when user from optimization function when, by currently without enter Journey is closed and discharges the virtual memory shared by the process of being closed.But, prior art can not solve do not closing the feelings of process Under condition, the problem of excessive caused system operation of shared virtual memory is slow.
The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome above mentioned problem or at least in part solve on State virtual memory compression method and device in the Windows systems of problem.
According to an aspect of the invention, there is provided virtual memory compression method in a kind of Windows systems, including:Block The resident thread cut in system process writes the behavior of data by virtual memory to virtual memory file, and data are compressed, It is stored in virtual memory;The behavior that resident thread reads data by virtual memory to virtual memory file is intercepted, be will be stored in Data in virtual memory are decompressed, and return to system process.
According to another aspect of the present invention there is provided virtual memory compression set in a kind of Windows systems, including:I/O Blocking module, the behavior of data is write suitable for the resident thread in intercepting system process by virtual memory to virtual memory file, And intercept the behavior that resident thread reads data by virtual memory to virtual memory file;Memory compression module, suitable in I/O After the resident thread of blocking module interception writes the behavior of data by virtual memory to virtual memory file, data are pressed Contracting, is stored in virtual memory;Internal memory decompression module, virtual memory is passed through suitable for intercepting resident thread in I/O blocking modules After the behavior that data are read to virtual memory file, the data that will be stored in virtual memory are decompressed, and return to system Process.
It is resident in virtual memory compression method and device, intercepting system process in the Windows systems of the present invention Thread writes the behavior of data by virtual memory to virtual memory file, and to virtual memory is stored back to after the data compression again and In not being disk;Afterwards, the behavior that resident thread reads the data by virtual memory to virtual memory file is intercepted, to compression Store and be sent to process to the data decompression of virtual memory, can be shared in current process all in the case of work When virtual memory is excessive, it is to avoid time that the frequent read-write to disk is caused wastes, and then solves system operation and slowly ask Topic.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And can be practiced according to the content of specification, and in order to allow above and other objects of the present invention, feature and advantage can Become apparent, below especially exemplified by the embodiment of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit is common for this area Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 shows the flow chart of virtual memory compression method in Windows systems according to an embodiment of the invention;
Fig. 2 shows the flow of virtual memory compression method in Windows systems in accordance with another embodiment of the present invention Figure;
Fig. 3 show in the Windows systems that one embodiment of the invention is provided virtual memory compression set with it is virtual in Deposit, virtual memory file connection structured flowchart.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Complete conveys to those skilled in the art.
Computer booting process is proceeded by after computer POST completion, and this process can be subdivided into Pre-boot, guiding, loading kernel, initialization kernel and system login operate this five stages, will be held during computer booting Row pre-boot, guiding, be loaded into kernel, file that initialization kernel is read from system disk when being operated to system login is as being System start file, the order that record reads the system boot file is used as the reading order got.Needed in start process The file of reading mainly include Ntldr, Boot.ini, Ntdetect.com, Ntoskrnl.exe, Ntbootdd.sys and The files such as Bootsect.dos, the main processes in each stage are as follows:
Pre-boot phase
After computer starting, BIOS self-inspections begin look for guiding equipment by rear, and the guiding needed under normal circumstances is set Standby is exactly hard disc of computer.BIOS reads the guidance code of first sector of hard disk, i.e. MBR(Master Boot Record, MBR)To internal memory, then by control right transfer to MBR codes.MBR code functions are the boot partitions for finding disk (boot partition), its first sector is boot sector(boot sector), the volume is referred to as system volume(system volume).
Vectoring phase
The code of boot sector is capable of the file format of resolution system volume, and finds Ntldr, the program can by processor by Real pattern(Real Mode)Switch to 32 flat memorymodels(32-bit Flat Memory Mode).Ntldr programs exist Boot.ini files, the content selection operation system in this document are read in meeting from hard disk after completing initial work System.After it have selected the Windows operating system for needing to be loaded into, Ntdetect.com is by all hardware installed in computer Information gets up, and gives Ntldr by the information.
It is loaded into the kernel stage
The kernel file Ntoskrnl.exe of loading system, but be only to be loaded into here, kernel now will not also be initial Change.It is then subsequently loaded into hardware abstraction layer HAL.dll.Load SYSTEM registration tablies storage nest file(%SystemRoot%\system32\ Config\System)For registration table key assignments(HKEY_LOCAL_MACHINE\SYSTEM), guide equipment to drive according in registration table Corresponding file system driver is added in dynamic list, with realize to each subregion, catalogue, file Access Management Access.
Initialize the kernel stage
Kernel initialization process can be loaded(HKEY_LOCAL_MACHINE\SYSTEM\
CurrentControlSet\services)The driving of middle record, such as disk management filtration drive, network-driven Deng.It is 1 (SERVICE_ that first loading, which is registered as the driving of " Start " key assignments 0 (SERVICE_BOOT_START) and then loads key assignments, SYSTEM_START driving).Scan first(HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Control\ServiceGro upOrder)Defined in group loading sequence, load registered driving successively according to group, The group of registered driving can be recorded in registration table key assignments " Group ".Driving to identical group, can be according to registration table key assignments " Tag " determines loading sequence.GroupOrderList(HKEY_LOCAL_MACHINE\SYSTEM\ CurrentControlSet\Control\GroupOrder List)In the Section 1 each organized be Tag values numerical value.Connect It is the numerical order for the Tag values to be loaded to get off.Device driver in group is first according to it by GroupOrderList institutes The Tag values of definition are loaded.If device driver does not have Tag values, or Tag values are not in GroupOrderList, Then these device drivers will be loaded being loaded with after the device driver of effective Tag value.
The system login stage
Start local security authorization subsystem in this stage session manager.Go to after this step, Computer display The login interface of Windows systems can be shown on screen, at the same time, backstage can load some non-key device drives.
By the operation in above-mentioned five stages, computer booting process is finished, so as to know system boot when institute The system boot file of reading in need and the reading order of these system boot files.
Fig. 1 shows the flow chart of virtual memory compression method in Windows systems according to an embodiment of the invention, As shown in figure 1, this method comprises the following steps:
Resident thread in step S110, intercepting system process writes the row of data by virtual memory to virtual memory file For data are compressed, are stored in virtual memory.
In the embodiment of the present invention, process refer to the program with certain standalone feature on some data acquisition system once Operation activity, process is the individual that system carries out Resource Distribution and Schedule;Thread refers to an entity of process, is The base unit that CPU is dispatched and assigned;Thread is the base unit of the energy independent operating smaller than process;Thread oneself is substantially Do not possess system resource, only possess a little essential resource in operation, but it can with belong to together process other Thread share whole resources for being possessed of process.A resident thread is had inside system process, when system is to virtual interior When the occupancy deposited is more than actual physics internal memory, the data being of little use can be write in virtual memory file.
Virtual memory file is to refer to the disk space that operating system retains for virtual memory, such as in Windows systems Pagefile.sys files, pagefile.sys files contain system in Windows operating system and set and variable, use In the Windows functions of the function of operation operating system, conventional storage device driver and other cores.When system takes Virtual memory space be more than actual physics internal memory when, Windows systems can wake up the resident thread for skipping, reside thread The behavior for making virtual memory write data to virtual memory file can be performed, that is, is sent the related data of current process out of virtually Request of the write-in into virtual memory file is deposited, bigger virtual memory space is provided by pagefile.sys files, from And meet demand of the process to bigger internal memory;This step is intercepted to the request, by request write-in virtual memory file Data are compressed, and then return the data storage in virtual memory, and not write data into disk as prior art.
Step S120, intercepts the behavior that resident thread reads data by virtual memory to virtual memory file, will be stored in Data in virtual memory are decompressed, and return to system process.
When process, which needs to read, is stored in the data compressed in virtual memory, due to process and the data are unaware of It is not written in disk, can still allows resident thread to perform the behavior for reading the data to virtual memory file by virtual memory, Send the request that the data that the process is needed to use are read from virtual memory file;This step is intercepted to the request, Data that are that the process requested is read and being compressed to virtual memory are decompressed, and return to process.
Resident thread in the method provided according to the above embodiment of the present invention, intercepting system process by virtual memory to Virtual memory file writes the behavior of data, and to being stored back to again in virtual memory rather than disk after the data compression;Afterwards, block The behavior that resident thread reads the data by virtual memory to virtual memory file is cut, compression is stored to the number of virtual memory , can be in current process all in the case of work, when shared virtual memory is excessive according to process is sent to after decompression, it is to avoid The time that frequent read-write to disk is caused wastes, and then solves the problem of system operation is slow.Further solve disk Contact frequent switching in magnetic track moves back and forth the problem of file read access time caused is long back and forth, can significantly improve calculating The starting up speed of machine, more efficiently realizes the purpose that computer booting accelerates.
It can be applied in the embodiment of the present invention in new technology file system, then system boot file is calculating under NTFS systems The file read is needed when machine is started shooting.New technology file system provides file system for Microsoft Windows sequence of maneuvers systems System.NTFS is to traditional file allocation table(FAT, File Allocation Table)System and HPFS (HPFS, High-Performance File System)Make some improvement, for example, supporting metadata, and use height DBMS structure, in order to improve performance, reliability and disk space usage, and provides some additional extension functions, such as Accesses control list and file system journal.The characteristics of NTFS including support the subregions of 2TB sizes, recoverable file system, Support folder compression and effectively hyperdisk space etc..
Fig. 2 shows the flow of virtual memory compression method in Windows systems in accordance with another embodiment of the present invention Figure, as shown in Fig. 2 this method comprises the following steps:
Resident thread in step S210, the file filter function of being provided using Windows systems, intercepting system process is led to Cross the behavior that virtual memory writes data to virtual memory file.
When virtual memory is to virtual memory file(pagefile.sys)When writing data, i.e., when to write, utilize The file filter function that Windows systems are provided, is intercepted to the behavior that data are write to pagefile.sys files.Specifically Ground, the present invention realizes the interception function by developing filter Driver on FSD.Filter Driver on FSD is a kind of Windows system kernels The driving of pattern, the I/O that it is sent to already present kernel mode target drives by intercepting asks to provide new additional function, Without making bottom layer driving or user program make any change.Filter Driver on FSD intercepts to pagefile.sys files and writes data Request and obtain request to pagefile.sys files write data.Filter Driver on FSD is skipped different from internal memory.Internal memory Skip and belong to memory management, it is necessary to know that source program could be carried out.And filter Driver on FSD offer is the auxiliary of Windows systems Function, filter Driver on FSD can intercept virtual memory in the case where not knowing source program and write data to virtual memory file Behavior.
Step S220, calculates the compression ratio of data, and the step is the optional step of the present embodiment.
With the disk space ratio shared by the file after compression before the contracting of compression ratio finger pressure.The compression ratio of data is high, illustrates number According to redundancy it is high, i.e. the repetitive rate of data is high, is adapted to compression.The present embodiment is to asking what is write to pagefile.sys files Data are compressed than calculating, and obtain result of calculation.According to result of calculation, the high data of prioritizing selection compression ratio are subsequently pressed Contracting is handled.A kind of optional embodiment is to preset a threshold value, and selection compression ratio is greater than or equal to the number of the given threshold According to progress subsequent compression processing;It is less than the data of the given threshold for compression ratio, can be written into according to existing method In pagefile.sys files, the compression ratio of data is low, illustrates that the redundancy of data is low, i.e. the repetitive rate of data is low, is not suitable for The data of unsuitable compression are write direct virtual memory file by compression, it is to avoid the problem of compression efficiency is low.Setting here Determine threshold value and could be arranged to 96%, but be not limited.
The embodiment of the present invention is also not limited to aforesaid way, it would however also be possible to employ other modes selection data carry out follow-up pressure Contracting is handled, and its selection gist is in addition to according to compression ratio, it is also contemplated that other factorses.
Step S230, the data using LZO series of compression algorithm by compression ratio greater than or equal to given threshold are compressed, It is stored in virtual memory.
LZO(Lempel-Ziv-Oberhumer)Series of compression algorithm is a kind of data compression lossless compression, passes through software Instrument lzop is realized.Data block can be compressed into matched data by LZO series of compression algorithm(Sliding dictionary)With non-matching word Sequence.And LZO has special processing for longer matched data and longer non-matching word sequence, so for The data of high redundancy can obtain good effect, and acceptable effect can be also obtained for incompressible data Really.LZO series of compression algorithm decompression is simple, compression/decompression speed is very fast, only need to take 64k virtual memorys.Therefore use LZO series of compression algorithms are compressed to data, are more than for the space that Windows systems take virtual memory in actual physics Situation about depositing, can further reduce the occupancy of virtual memory, the overall speed of service of lifting system.The embodiment of the present invention is not yet It is only limitted to use LZO series of compression algorithms, other data compression lossless compressions can also be used.
Step S240, the file filter function of being provided using Windows systems, intercept resident thread by virtual memory to Virtual memory file reads the behavior of data.
Be compressed when process needs to read by step S230 and when being stored back to the data of virtual memory, system according to Original virtual memory extension mechanism, still believes that the data storage in pagefile.sys files, and system can be to Pagefile.sys file requests read data needed for the process.Now, the file filter function of being provided by Windows systems The request that data are read to pagefile.sys files is intercepted.It is by file mistake specifically as described in step S210 Filter driving intercepts the row that resident thread reads data by virtual memory to virtual memory file in the case where not knowing source program For.
Step S250, the data that will be stored in virtual memory are decompressed, and return to process.
After interception reads the behavior of data needed for the process to pagefile.sys file requests, read from virtual memory The data are taken, decompression are carried out to data, decompression method and compression method used in step 230 here are relative Answer.The process of request is returned data to after decompression.
, can be in the case where not knowing source code, to virtual memory file by the above-mentioned process step of the present embodiment The behavior of read-write data is intercepted.In addition, on the one hand judging in advance if appropriate for compression data, to being not suitable for compression Data be directly stored in virtual memory file, on the other hand using to virtual memory require small, compression efficiency it is high LZO series press Compression algorithm is compressed, and can further save virtual memory free space, lifting system fortune on the premise of not closing process Scanning frequency degree.
Further, in the above-described embodiments, if until process is closed after step S230, process is not all sent out The request read and compressed the data being stored in virtual memory is sent, data storage takes in virtual memory in this case The space of virtual memory, makes other data to handle in time.In order to solve the problem, the embodiment of the present invention used one Planting optional method is:The internal memory for hooking up Windows systems using Hook Function discharges function;Hooking up internal memory release function Afterwards, cleaning is stored in the data in virtual memory.
Internal memory release function refers specifically to the function that Windows systems are called when process is closed, such as MiReleasePageFileSpace functions.Using the present invention's under the original virtual memory extension mechanism of Windows systems In the case of, when process is closed, Windows systems can call internal memory to discharge function.The embodiment of the present invention passes through Hook Function (Hook functions)Internal memory release function is hooked up, the notification message of process is closed as system, is carried using Windows systems Whether the process that Function detection goes out to take virtual memory space works.After internal memory release function is hooked up, cleaning is stored in Data in virtual memory, to complete data scrubbing.
Alternatively, method provided in an embodiment of the present invention, which can also be cleared up regularly, is stored in exceeding necessarily in virtual memory The data that time is not read, rather than cleared up again when after process closing.
The method provided according to the above embodiment of the present invention, is completed to virtual interior using the function of Windows systems in itself The interception and the release to data in virtual memory of file read-write data behavior are deposited, small, realization side is changed to existing system Just.It can be completed using file filter function in the case where not knowing source code to virtual memory file read-write data behavior Intercept.Compression efficiency can further be improved by being compressed using LZO series of compression algorithms, improve the speed of service of system.Profit Discharging function with internal memory in real time can discharge virtual memory useless, further improve system running speed.
Fig. 3 show in the Windows systems that one embodiment of the invention is provided virtual memory compression set 300 with it is virtual The structured flowchart that internal memory 370, virtual memory file 380 are connected, as shown in figure 3, the device 300 includes:I/O blocking modules 310, Memory compression module 320 and internal memory decompression module 330.
The resident thread that I/O blocking modules 310 are suitable in intercepting system process is literary to virtual memory by virtual memory 370 Part 380 writes the behavior of data, and intercepts the row that resident thread reads data by virtual memory 370 to virtual memory file 380 For.
Specifically, the file filter function that I/O blocking modules 310 are provided using Windows systems, intercepts resident thread and leads to The behavior that virtual memory 370 writes data to virtual memory file, and the file filter work(provided using Windows systems are provided Can, intercept the behavior that resident thread reads data by virtual memory 370 to virtual memory file.Using pagefile.sys files as Example, when I/O blocking modules 310, which are intercepted, writes the request of data to pagefile.sys files, I/O blocking modules 310 are inside Compression module 320 is deposited to send the request of data compression.Intercept and read to pagefile.sys files when I/O blocking modules 310 During the request of data, I/O blocking modules 310 are sent the request of data decompression to internal memory decompression module 330.
Specifically, I/O blocking modules 310 can be the filter Driver on FSD of exploitation.Filter Driver on FSD is a kind of The driving of Windows system kernel patterns, the I/O that it is sent to already present kernel mode target drives by intercepting asks to carry For new additional function, without making bottom layer driving or user program make any change.Filter Driver on FSD intercept to The request of pagefile.sys file read-write data.Filter Driver on FSD is skipped different from internal memory.Internal memory, which skips, belongs to internal memory pipe Reason is, it is necessary to know that source program could be carried out.And filter Driver on FSD offer is the miscellaneous function of Windows systems, file filter Driving can intercept the request to pagefile.sys file read-write data in the case where not knowing source program.
Memory compression module 320 is suitable to intercept resident thread by virtual memory 370 to virtual in I/O blocking modules 310 Memory file 380 is write after the behavior of data, and data are compressed, and is stored in virtual memory 370.
Specifically, data are compressed by memory compression module 320 using LZO series of compression algorithms.Memory compression module 320 requests by data compression sent according to I/O blocking modules 310, data are compressed, virtual memory 370 is stored in In.
Internal memory decompression module 330 is suitable to intercept resident thread by virtual memory 370 to void in I/O blocking modules 310 Intend after the behavior that memory file 380 reads data, the data that will be stored in virtual memory 370 are decompressed, return to feed Journey.
Specifically, the request by data decompression that internal memory decompression module 330 is sent according to I/O blocking modules 310, will be deposited The data stored up in virtual memory are decompressed, and return to process.
Alternatively, device of the invention also includes computing module 350 and writing module 360.
Computing module 350 is suitable to the compression ratio for calculating data.With the magnetic shared by the file after compression before the contracting of compression ratio finger pressure Disk space ratio.The compression ratio of data is high, illustrates that the redundancy of data is high, i.e. the repetitive rate of data is high, is adapted to compression.Calculate mould 350 pairs of block asks to be compressed than calculating to the data that pagefile.sys files write, and obtains result of calculation.Memory compression mould Block 320 is according to result of calculation, and the high data of prioritizing selection compression ratio carry out subsequent compression processing.A kind of optional embodiment It is to preset a threshold value, the data that memory compression module 320 is suitable to by compression ratio greater than or equal to given threshold are pressed Contracting.The data that writing module 360 is suitable to by compression ratio less than given threshold are write in virtual memory file 380;The compression of data Than low, illustrate that the redundancy of data is low, i.e. the repetitive rate of data is low, be not suitable for compression, the data of unsuitable compression are directly write Enter virtual memory file, it is to avoid the problem of compression efficiency is low.
Alternatively, device of the invention also includes memory management module 340, suitable for hooking up Windows using Hook Function The internal memory release function of system;After internal memory release function is hooked up, cleaning is stored in the data in virtual memory 370.It is interior Deposit release function and refer specifically to the function that Windows systems are called when process is closed, such as MiReleasePageFileSpace Function.In the case of the present invention being applied under the original virtual memory extension mechanism of Windows systems, when process is closed, Windows systems can call internal memory to discharge function.Memory management module 340 passes through Hook Function(Hook functions)Hook up the internal memory Function is discharged, the notification message of process is closed as system, the Function detection carried using Windows systems goes out to take in virtual Whether the process for depositing space works.Memory management module 340 is after internal memory release function is hooked up, and cleaning is stored in virtual Data in depositing, to complete data scrubbing.
Alternatively, memory management module 340, which can also be cleared up regularly, is stored in not having more than certain time in virtual memory There are the data being read, rather than cleared up again when after process closing.
The device provided according to embodiments of the present invention, can be in current process all in the case of work, shared void When plan internal memory is excessive, it is to avoid the time that the frequent read-write to disk is caused wastes, and then solves the problem of system operation is slow. In addition, being completed using the function of Windows systems in itself to the interception of virtual memory file read-write data behavior and to virtual The release of data in EMS memory, changes small to existing system, and it is convenient to realize.It can not know source code using file filter function In the case of complete the interception to virtual memory file read-write data behavior.Being compressed using LZO series of compression algorithms can Compression efficiency is further improved, the speed of service of system is improved.Discharging function using internal memory can in real time will be useless virtual interior Release is deposited, system running speed is further improved.Data are judged if appropriate for compression in advance, the number to being not suitable for compression According to virtual memory file is directly stored in, system running speed also can be further improved.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together with based on teaching in this.As described above, construct required by this kind of system Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It is understood that, it is possible to use it is various Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the specification that this place is provided, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect, exist Above in the description of the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:It is i.e. required to protect The application claims of shield features more more than the feature being expressly recited in each claim.More precisely, such as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself All as the separate embodiments of the present invention.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit exclude each other, it can use any Combination is to this specification(Including adjoint claim, summary and accompanying drawing)Disclosed in all features and so disclosed appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification(Including adjoint power Profit requires, made a summary and accompanying drawing)Disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation Replace.
Although in addition, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments In included some features rather than further feature, but the combination of the feature of be the same as Example does not mean in of the invention Within the scope of and form different embodiments.For example, in the following claims, times of embodiment claimed One of meaning mode can be used in any combination.
The present invention all parts embodiment can be realized with hardware, or with one or more processor run Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that can use in practice Microprocessor or digital signal processor(DSP)To realize virtual memory in Windows systems according to embodiments of the present invention The some or all functions of some or all parts in compression set.The present invention is also implemented as being used to perform here Some or all equipment or program of device of described method(For example, computer program and computer program production Product).Such program for realizing the present invention can be stored on a computer-readable medium, or can have one or more The form of signal.Such signal can be downloaded from internet website and obtained, and either be provided or on carrier signal to appoint What other forms is provided.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of some different elements and coming real by means of properly programmed computer It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame Claim.

Claims (8)

1. virtual memory compression method in a kind of Windows systems, including:
Resident thread in intercepting system process writes the behavior of data by virtual memory to virtual memory file, calculates data Compression ratio, will ask the compression ratio in write-in virtual memory file to be compressed greater than or equal to the data of given threshold, stores In the virtual memory rather than disk;Data by compression ratio less than the given threshold write the virtual memory file In;Wherein, it is specially, it is necessary to will not when system is more than actual physics internal memory to the occupancy of virtual memory to reside thread Thread in conventional data write-in virtual memory file;
Intercept the behavior that the resident thread reads the data by virtual memory to virtual memory file, by asking to read and The data having stored in the virtual memory are decompressed, and return to the system process.
2. according to the method described in claim 1, wherein:
The behavior that resident thread in the intercepting system process writes data by virtual memory to virtual memory file is specially: The file filter function of being provided using Windows systems, resident thread in intercepting system process is by virtual memory to virtual Memory file writes the behavior of data;
It is described to intercept the behavior that the resident thread reads the data by virtual memory to virtual memory file and be specially:Utilize The file filter function that Windows systems are provided, intercepts the resident thread and reads institute to virtual memory file by virtual memory State the behavior of data.
3. method according to claim 1 or 2, in addition to:
The internal memory for hooking up Windows systems using Hook Function discharges function;
After the internal memory release function is hooked up, cleaning is stored in the data in the virtual memory.
4. method according to claim 1 or 2, described to be compressed data specially:Utilize LZO series of compression algorithms Data are compressed.
5. virtual memory compression set in a kind of Windows systems, including:
I/O blocking modules, data are write suitable for the resident thread in intercepting system process by virtual memory to virtual memory file Behavior, and intercept the behavior that the resident thread reads the data by virtual memory to virtual memory file;Wherein, often It is specially, it is necessary to by the data being of little use when system is more than actual physics internal memory to the occupancy of virtual memory in thread The thread write in virtual memory file;
Computing module, the compression ratio suitable for calculating the data;
Memory compression module, suitable for intercepting the resident thread by virtual memory to virtual memory in the I/O blocking modules File is write after the behavior of data, by the data for asking the compression ratio in write-in virtual memory file to be greater than or equal to given threshold It is compressed, is stored in the virtual memory rather than disk;
Writing module, writes in the virtual memory file suitable for the data by compression ratio less than the given threshold;
Internal memory decompression module, suitable for intercepting the resident thread by virtual memory in virtual in the I/O blocking modules Deposit after the behavior that file reads the data, the data that are reading and having stored in the virtual memory will be asked to enter Row decompression, returns to the system process.
6. device according to claim 5, the I/O blocking modules are particularly adapted to:The text provided using Windows systems Part filtering function, intercepts the behavior that the resident thread writes data by virtual memory to virtual memory file, and intercept institute State the behavior that resident thread reads the data by virtual memory to virtual memory file.
7. the device according to claim 5 or 6, in addition to:Memory management module, suitable for being hooked up using Hook Function The internal memory release function of Windows systems;After the internal memory release function is hooked up, cleaning is stored in the virtual memory In the data.
8. the device according to claim 5 or 6, the memory compression module is particularly adapted to:Utilize LZO series of compression algorithms Data are compressed.
CN201310656949.2A 2013-12-06 2013-12-06 Virtual memory compression method and device in a kind of Windows systems Active CN103617133B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310656949.2A CN103617133B (en) 2013-12-06 2013-12-06 Virtual memory compression method and device in a kind of Windows systems

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310656949.2A CN103617133B (en) 2013-12-06 2013-12-06 Virtual memory compression method and device in a kind of Windows systems

Publications (2)

Publication Number Publication Date
CN103617133A CN103617133A (en) 2014-03-05
CN103617133B true CN103617133B (en) 2017-08-25

Family

ID=50167836

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310656949.2A Active CN103617133B (en) 2013-12-06 2013-12-06 Virtual memory compression method and device in a kind of Windows systems

Country Status (1)

Country Link
CN (1) CN103617133B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107608782B (en) * 2016-07-11 2021-01-29 斑马智行网络(香港)有限公司 Memory compression method and device, operating system and electronic equipment
CN106997316B (en) * 2017-04-11 2020-02-21 上海联彤网络通讯技术有限公司 System and method for detecting abnormal increase of memory
CN109254954B (en) * 2018-09-13 2020-06-09 政采云有限公司 File processing method and device, computing equipment and storage medium
CN109445693A (en) * 2018-10-19 2019-03-08 郑州云海信息技术有限公司 A kind of data compression method and device
CN110457235B (en) * 2019-08-20 2021-10-08 Oppo广东移动通信有限公司 Memory compression method, device, terminal and storage medium
CN113742299B (en) * 2020-05-27 2024-01-02 奇安信网神信息技术(北京)股份有限公司 File compression and decompression method and file compression and decompression device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103399915A (en) * 2013-07-31 2013-11-20 北京华易互动科技有限公司 Optimal reading method for index file of search engine

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103399915A (en) * 2013-07-31 2013-11-20 北京华易互动科技有限公司 Optimal reading method for index file of search engine

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Windows文件系统微过滤驱动模型的文件透明加解密系统的研究与实现;林海元;《中国优秀硕士学位论文全文数据库 信息科技辑》;20100215;第2010卷(第2期);第1.2,2.2-3.4,4.1.1-4.1.5节,附图5.1 *

Also Published As

Publication number Publication date
CN103617133A (en) 2014-03-05

Similar Documents

Publication Publication Date Title
US20230244395A1 (en) Virtual disk storage techniques
CN103617133B (en) Virtual memory compression method and device in a kind of Windows systems
US8239648B2 (en) Reclamation of thin provisioned disk storage
CN104011677B (en) Method and system for deployment of a software image on multiple targets with streaming technique
US8868622B2 (en) Method and apparatus for allocating resources in a computer system
US9495396B2 (en) Increased database performance via migration of data to faster storage
US20200133875A1 (en) Method, apparatus and computer program product for managing data access
EP2972747B1 (en) Data storage, file and volume system providing mutliple tiers
KR102434170B1 (en) hybrid memory system
CN104111897A (en) Data processing method, data processing device and computer system
US7085907B2 (en) Dynamic reconfiguration of memory in a multi-cluster storage control unit
CN103761053A (en) Data and method for data processing
CN110806911B (en) Cloud desktop management and control method, device and system
JP5439236B2 (en) Computer system and method of executing application program
US9792050B2 (en) Distributed caching systems and methods
CN109885642B (en) Hierarchical storage method and device for full-text retrieval
KR20200123850A (en) Hybrid memory system
US9176676B2 (en) Efficiency of virtual machines that use de-duplication as primary data storage
US20180025022A1 (en) Delayed allocation for data object creation
CN108475201A (en) A kind of data capture method in virtual machine start-up course and cloud computing system
JP2005196793A (en) Method, system and product for reserving memory
CN102968323A (en) Computer terminal and method for accelerating starting-up of computer system
US8468303B2 (en) Method and apparatus to allocate area to virtual volume based on object access type
US8504764B2 (en) Method and apparatus to manage object-based tiers
CN102968324B (en) The method for sorting of computer system power-on file and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220801

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.

TR01 Transfer of patent right