CN103617133A - Method and device for compressing virtual memory in Windows system - Google Patents

Method and device for compressing virtual memory in Windows system Download PDF

Info

Publication number
CN103617133A
CN103617133A CN201310656949.2A CN201310656949A CN103617133A CN 103617133 A CN103617133 A CN 103617133A CN 201310656949 A CN201310656949 A CN 201310656949A CN 103617133 A CN103617133 A CN 103617133A
Authority
CN
China
Prior art keywords
virtual memory
data
file
compression
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.)
Granted
Application number
CN201310656949.2A
Other languages
Chinese (zh)
Other versions
CN103617133B (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

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method and device for compressing a virtual memory in a Windows system. The method includes the steps of cutting off the behavior that a permanent thread in a system process writes data into a virtual memory file through the virtual memory, compressing the data, and storing the data into the virtual memory; cutting off the behavior that the permanent thread reads data from the virtual memory file through the virtual memory, uncompressing the data stored in the virtual memory, and returning the data to the system process. According to the method and device for compressing the virtual memory in the Windows system, time waste caused by frequent reading and writing of magnetic disks can be avoided when occupied virtual memory is too large under the condition that the whole current process works, and therefore the problem that the system runs slowly is solved.

Description

Virtual memory compression method and device in a kind of Windows system
Technical field
The present invention relates to computer system optimizing technical field, be specifically related to virtual memory compression method and device in a kind of Windows system.
Background technology
During computer booting, need to from disk, start computer system by file reading.Under a lot of scenes, file be not be kept at disk continuous bunch in, but be dispersed the diverse location that is saved in whole disk, on disk, produced file fragmentation.For example, when the disk space of storage file is inadequate, deleted file or can produce a large amount of file fragmentations while adding file on disk, more frequent to revising of file, the phenomenon of file fragmentation is more serious.During due to the file of diverse location in reading disk, disk contact need to move to different positions, file fragmentation can make disk contact frequently move back and forth, cause file to read overlong time, therefore, existing scheme, by the file fragmentation of a file being filled in to space continuous in disk, shortens the time of reading this document in start process, to accelerate the starting up speed of computer system.
And in the process of computer booting, the program of moving in computing machine all need be carried out via internal memory, if the program committed memory of carrying out is very large or a lot, can cause memory consumption totally.For addressing this problem, in Windows system, used virtual memory technology, evenly go out a part of disk space and serve as internal memory and use.When internal memory exhausts, computing machine will serve as internal memory by Automatically invoked disk, with answering system, the occupancy of virtual memory is greater than the situation of actual physics internal memory.Virtual memory technology makes application program think that it has continuous available internal memory (address space of a continuous whole).
The realization mechanism of the virtual memory technology in Windows system is specially: under system disk, configure a virtual memory file pagefile.sys, be the disk space that virtual memory retains; When the virtual memory that takies when process is excessive, the temporary transient unwanted data of current process are changed to virtual memory file from virtual memory; When process reads the data that change in virtual memory file, then these data are changed in virtual memory from virtual memory file.This mechanism has been expanded the space of virtual memory, makes virtual memory not only can utilize actual physical memory storage data, can also utilize a part of spatial spread virtual memory in disk with storage data.Yet to disk read-write data, can expend the plenty of time frequently, thereby cause computer system to move problem slowly.
When prior art adopts system optimization speed technology solution process to take a large amount of internal memory, computer system is moved problem slowly.Some functions of optimize accelerating that for example computing machine provides, when user selects optimizational function, close current useless process and discharge the shared virtual memory of the process of being closed.But prior art cannot solve the in the situation that of rev down process rev not, the system that shared virtual memory is excessive caused is moved problem slowly.
Summary of the invention
In view of the above problems, the present invention has been proposed to virtual memory compression method and device in a kind of Windows system that overcomes the problems referred to above or address the above problem is at least in part provided.
According to an aspect of the present invention, virtual memory compression method in a kind of Windows system is provided, comprise: the resident thread in intercepting system process is write the behavior of data to virtual memory file by virtual memory, data are compressed, and is stored in virtual memory; The resident thread behavior to virtual memory file read data by virtual memory of interception, decompresses the data that are stored in virtual memory, returns to system process.
According to a further aspect in the invention, virtual memory compression set in a kind of Windows system is provided, comprise: I/O blocking module, the resident thread being suitable in intercepting system process is write the behavior of data to virtual memory file by virtual memory, and the resident thread behavior to virtual memory file read data by virtual memory of interception; Internal memory compression module, be suitable for the resident thread of I/O blocking module interception by virtual memory after virtual memory file is write the behavior of data, data are compressed, be stored in virtual memory; Internal memory decompression module, be suitable for the resident thread of I/O blocking module interception by virtual memory after the behavior of virtual memory file read data, the data that are stored in virtual memory are decompressed, return to system process.
According to virtual memory compression method and device in Windows system of the present invention, the resident thread in intercepting system process is write the behavior of data to virtual memory file by virtual memory, and to again depositing back after this data compression in virtual memory rather than disk; Afterwards, the resident thread of interception reads the behavior of these data to virtual memory file by virtual memory, after compressing the data decompression that is stored to virtual memory, send to process, can be in current process all in the situation that working, when shared virtual memory is excessive, avoid the time waste that the frequent read-write of disk is caused, and then the system that solved is moved problem slowly.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to better understand technological means of the present invention, and can be implemented according to the content of instructions, and for above and other objects of the present invention, feature and advantage can be become apparent, below especially exemplified by the specific embodiment of the present invention.
Accompanying drawing explanation
By reading below detailed description of the preferred embodiment, various other advantage and benefits will become cheer and bright for those of ordinary skills.Accompanying drawing is only for the object of preferred implementation is shown, and do not think limitation of the present invention.And in whole accompanying drawing, by identical reference symbol, represent identical parts.In the accompanying drawings:
Fig. 1 shows the process flow diagram of virtual memory compression method in Windows system according to an embodiment of the invention;
Fig. 2 shows the process flow diagram of virtual memory compression method in Windows system in accordance with another embodiment of the present invention;
Fig. 3 shows the structured flowchart that in the Windows system that one embodiment of the invention provides, virtual memory compression set is connected with virtual memory, virtual memory file.
Embodiment
Exemplary embodiment of the present disclosure is described below with reference to accompanying drawings in more detail.Although shown exemplary embodiment of the present disclosure in accompanying drawing, yet should be appreciated that and can realize the disclosure and the embodiment that should do not set forth limits here with various forms.On the contrary, it is in order more thoroughly to understand the disclosure that these embodiment are provided, and can by the scope of the present disclosure complete convey to those skilled in the art.
Computer booting process starts to carry out after computing machine POST completes, this process can be subdivided into pre-guiding, guides, is written into kernel, initialization kernel and system login operate this double teacher, using carrying out in computer booting process, guide in advance, guide, be written into file that kernel, initialization kernel read from system disk when system login operate as system boot file, record read this system boot file order as the reading order getting.In start process, need the file reading mainly to comprise the files such as Ntldr, Boot.ini, Ntdetect.com, Ntoskrnl.exe, Ntbootdd.sys and Bootsect.dos, the main processing procedure in each stage is as follows:
The pre-vectoring phase
After computer starting, after BIOS self check is passed through, start to find guiding device, the equipment of the guiding needing is under normal circumstances exactly hard disc of computer.BIOS reads the guidance code of first sector of hard disk, and Main Boot Record (Master Boot Record, MBR), to internal memory, is then transferred to control MBR code.MBR code function is the boot partition (boot partition) of finding disk, and its first sector is boot sector (boot sector), and this volume is called system volume (system volume).
Vectoring phase
The code of boot sector can resolution system the file layout of volume, and find Ntldr, this program can switch to 32 smooth memorymodels (32-bit Flat Memory Mode) by real pattern (Real Mode) by processor.Ntldr program can read boot.ini file from hard disk after having completed initial work, according to the content choice operating system in this document.After having selected the Windows operating system that need to be written into, Ntdetect.com is all hardware information of installing in computing machine, and gives Ntldr by this information.
Be written into the kernel stage
The kernel file Ntoskrnl.exe of loading system, but be only written into here, kernel now also can not be initialised.Be written into subsequently hardware abstraction layer HAL.dll.Loading SYSTEM registration table storage nest file (%SystemRoot% system32 Config System) is registration table key assignments (HKEY_LOCAL_MACHINE SYSTEM), according to guiding device in registration table, drive list to add corresponding file system driver, to realize the Access Management Access to each subregion, catalogue, file.
The initialization kernel stage
Kernel initialize process can load (HKEY_LOCAL_MACHINE SYSTEM
CurrentControlSet services) in record driving, as disk management filtration drive, network-driven etc.The driving that first loading is registered as " Start " key assignments 0 (SERVICE_BOOT_START) then loads the driving that key assignments is 1 (SERVICE_SYSTEM_START).First scanning (HKEY_LOCAL_MACHINE SYSTEM CurrentControlSet Control ServiceGro upOrder) in definition group loading sequence, according to group, load successively registered driving, the group of registered driving can be recorded in registration table key assignments " Group ".Driving to identical group, can decide loading sequence according to registration table key assignments " Tag ".GroupOrderList(HKEY_LOCAL_MACHINE SYSTEM CurrentControlSet Control GroupOrder List) in first of each group be the numerical value of Tag value.Next be the numerical order of the Tag value that will load.First device driver in group is loaded by the defined Tag value of GroupOrderList according to it.If device driver does not have Tag value, or Tag value is in GroupOrderList, and these device drivers load by have the device driver of effective Tag value in loading after.
The system login stage
At this stage session manager, start local security authorization subsystem.Carry out after this step, can show the login interface of Windows system on computer display, meanwhile, backstage can load some non-key device drives.
By the operation of above-mentioned double teacher, computer booting process is finished, thus the reading order of the system boot file that while having known system boot, all needs read and these system boot files.
Fig. 1 shows the process flow diagram of virtual memory compression method in Windows system according to an embodiment of the invention, and as shown in Figure 1, the method comprises the steps:
Step S110, the resident thread in intercepting system process is write the behavior of data to virtual memory file by virtual memory, data are compressed, and is stored in virtual memory.
In the embodiment of the present invention, process refers to that the program with certain standalone feature is about the once operation activity on certain data acquisition, and process is the individual that system is carried out Resource Distribution and Schedule; Thread refers to an entity of process, is the base unit of CPU scheduling and assignment; Thread be than process less can independent operating base unit; Thread oneself does not have system resource substantially, only has any requisite resource that is in operation, but it can share whole resources that process has with other the thread that belongs to a process together.In system process the inside, have a resident thread, when system is greater than actual physics internal memory to the occupancy of virtual memory, the data that are of little use can be write in virtual memory file.
Virtual memory file refers to that operating system is the disk space that virtual memory retains, the pagefile.sys file in Windows system for example, pagefile.sys file including system setting and the variable in Windows operating system, for the function of operation system, conventional memory device driver and the Windows function of other cores.When the virtual memory space that system takies is greater than actual physics internal memory, Windows system can be waken the resident thread for skipping up, resident thread can be carried out and make virtual memory to virtual memory file, write the behavior of data, send the related data of current process is write to the request in virtual memory file from virtual memory, by pagefile.sys file, provide larger virtual memory space, thereby meet the demand of process to larger internal memory; This step is tackled this request, and the data that request is write in virtual memory file are compressed, and then these data is stored back in virtual memory, and not as prior art data is write to disk.
Step S120, the resident thread behavior to virtual memory file read data by virtual memory of interception, decompresses the data that are stored in virtual memory, returns to system process.
When process need to read the data of having compressed that are stored in virtual memory, because process is not known these data and is not written in disk, still can allow resident thread execution by virtual memory, to virtual memory file, read the behavior of these data, send the request of reading the data that this process need to be used from virtual memory file; This step is tackled this request, and the data that this process requested read and be compressed to virtual memory are carried out decompress(ion), and return to process.
The method providing according to the above embodiment of the present invention, the resident thread in intercepting system process is write the behavior of data to virtual memory file by virtual memory, and to again depositing back after this data compression in virtual memory rather than disk; Afterwards, the resident thread of interception reads the behavior of these data to virtual memory file by virtual memory, after compressing the data decompression that is stored to virtual memory, send to process, can be in current process all in the situation that working, when shared virtual memory is excessive, avoid the time waste that the frequent read-write of disk is caused, and then the system that solved is moved problem slowly.Further solve the frequent switching in magnetic track of disk contact and moved back and forth back and forth the problem that the file causing reads overlong time, can significantly improve opening computer speed, more effectively realized the object that computer booting accelerates.
In the embodiment of the present invention, can be applied in new technology file system, system boot file is the file that need to read during computer booting under NTFS system.The Windows series operating system that new technology file system is Microsoft provides file system.NTFS is to traditional file allocation table (FAT, File Allocation Table) system and HPFS (High-Performance File System) (HPFS, High-Performance File System) some improvement have been done, for example, support metadata, and used high-level data structure, so that improve performance, reliability and disk space utilization factor, and some additional extension functions are provided, as Access Control List (ACL) and file system journal.The feature of NTFS comprises subregion, recoverable file system, support folder compression and effective hyperdisk space of supporting 2TB size etc.
Fig. 2 shows the process flow diagram of virtual memory compression method in Windows system in accordance with another embodiment of the present invention, and as shown in Figure 2, the method comprises the steps:
Step S210, the file filter function of utilizing Windows system to provide, the resident thread in intercepting system process is write the behavior of data to virtual memory file by virtual memory.
When virtual memory is write data to virtual memory file (pagefile.sys), while writing data to disk, the file filter function of utilizing Windows system to provide, subtend pagefile.sys file is write the behavior of data and is tackled.Particularly, the present invention realizes this interception function by exploitation filter Driver on FSD.Filter Driver on FSD is a kind of driving of Windows system kernel pattern, and it relies on the I/O that already present kernel mode target drives is mail in interception to ask the additional function that provides new, and can not make bottom layer driving or user program make any change.Filter Driver on FSD is tackled to the data that pagefile.sys file is write the request of data and the request of obtaining writes to pagefile.sys file.Filter Driver on FSD is different from internal memory and skips.Internal memory skips and belongs to memory management, need to know that source program just can carry out.And filter Driver on FSD to provide be the subsidiary function of Windows system, filter Driver on FSD can be tackled virtual memory and to virtual memory file, be write the behavior of data in the situation that not knowing source program.
Step S220, the ratio of compression of computational data, the optional step that this step is the present embodiment.
The shared disk space ratio of file before the contracting of ratio of compression finger pressure and after compression.The ratio of compression of data is high, illustrates that the redundance of data is high, and the repetition rate of data is high, is applicable to compression.The data that the present embodiment writes to pagefile.sys file request are carried out ratio of compression calculating, obtain result of calculation.According to result of calculation, preferentially select the data that ratio of compression is high to carry out subsequent compression processing.A kind of optional embodiment is, presets a threshold value, selects ratio of compression to carry out subsequent compression processing greater than or equal to the data of this setting threshold; Data for ratio of compression lower than this setting threshold, can be write in pagefile.sys file according to existing method, the ratio of compression of data is low, the redundance that data are described is low, the repetition rate that is data is low, be not suitable for compression, by being not suitable for the data virtual memory file that writes direct of compression, avoided the problem that compression efficiency is low.The setting threshold here can be set to 96%, but not as limit.
The embodiment of the present invention is also not limited only to aforesaid way, also can adopt other modes to select data to carry out follow-up compression and process, and it selects, according to except according to ratio of compression, also can consider other factors.
Step S230, utilizes LZO series compression algorithm that ratio of compression is compressed greater than or equal to the data of setting threshold, is stored in virtual memory.
LZO(Lempel-Ziv-Oberhumer) serial compression algorithm is a kind of data compression lossless compression, and by Software tool, lzop realizes.LZO series compression algorithm can be compressed into data block the sequence of matched data (slip dictionary) and non-matching word.And LZO has special processing for longer matched data and long non-matching word sequence, the data for high redundancy can obtain good effect like this, and also can obtain acceptable effect for incompressible data.LZO series compression algorithm decompress(ion) is simple, compression/decompression speed very soon, only needs to take 64k virtual memory.Therefore use LZO series compression algorithm to compress data, the situation that the space that takies virtual memory for Windows system is greater than actual physics internal memory, can further reduce taking of virtual memory, the travelling speed of Hoisting System integral body.The embodiment of the present invention is also not limited only to use LZO series compression algorithm, also can use other data compression lossless compression.
Step S240, the file filter function of utilizing Windows system to provide, the resident thread behavior to virtual memory file read data by virtual memory of interception.
When process need to read when compressing by step S230 and depositing back the data of virtual memory, system is according to original virtual memory extension mechanism, still think that these data are stored in pagefile.sys file, system can read this process desired data to pagefile.sys file request.The request of the file filter function subtend pagefile.sys file reading out data now, providing by Windows system is tackled.As described in step S210, be by filter Driver on FSD, in the situation that not knowing source program, to be tackled resident thread behavior to virtual memory file read data by virtual memory particularly.
Step S250, decompresses the data that are stored in virtual memory, returns to process.
In interception, to pagefile.sys file request, read after the behavior of this process desired data, read these data from virtual memory, data are carried out to decompression, the compression method that the decompression method is here used with step 230 is corresponding.After decompression, data are returned to the process of request.
By the above-mentioned treatment step of the present embodiment, can be in the situation that not knowing source code, the behavior of subtend virtual memory file read-write data is tackled.In addition, in advance whether data being applicable to compression on the one hand judges, to being not suitable for the data of compression, directly deposit virtual memory file in, adopt on the other hand the LZO series compression algorithm little to virtual memory requirement, compression efficiency is high to compress, can, under the prerequisite of rev down process rev not, further save virtual memory free space, Hoisting System travelling speed.
Further, in the above-described embodiments, if closed up to process after step S230, process does not all have to send to read to compress the request that is stored in the data in virtual memory, data are stored in the space that takies virtual memory in virtual memory in this case, make other data can not get timely processing.In order to address this problem, a kind of optional method that the embodiment of the present invention adopts is: the internal memory that utilizes Hook Function to hook up Windows system discharges function; After hooking up internal memory release function, cleaning is stored in the data in virtual memory.
Internal memory discharges function and specifically refers to the function that Windows system is called when process is closed, as MiReleasePageFileSpace function.Under the original virtual memory extension mechanism of Windows system, apply in situation of the present invention, when process is closed, Windows system can discharge function by invoke memory.The embodiment of the present invention hooks up this internal memory by Hook Function (hook function) and discharges function, and as the notification message of system closing process, whether the process of utilizing Function detection that Windows system carries to go out to take virtual memory space works.After hooking up internal memory release function, cleaning is stored in the data in virtual memory, to complete data scrubbing.
Alternatively, the method that the embodiment of the present invention provides also can regularly be cleared up the data that certain hour is not read that surpass that are stored in virtual memory, rather than process is cleared up after closing again by the time.
The method providing according to the above embodiment of the present invention, utilizes the function of Windows system itself to complete interception and the release to data in virtual memory to the behavior of virtual memory file read-write data, little to existing system change, and it is convenient to realize.Utilize file filter function can in the situation that not knowing source code, complete the interception to the behavior of virtual memory file read-write data.Utilize LZO series compression algorithm to compress and can further improve compression efficiency, improve the travelling speed of system.Utilizing internal memory to discharge function can discharge virtual memory useless in real time, further improves system running speed.
Fig. 3 shows the structured flowchart that in the Windows system that one embodiment of the invention provides, virtual memory compression set 300 is connected with virtual memory 370, virtual memory file 380, as shown in Figure 3, this device 300 comprises: I/O blocking module 310, internal memory compression module 320 and internal memory decompression module 330.
The resident thread that I/O blocking module 310 is suitable in intercepting system process is write the behavior of data to virtual memory file 380 by virtual memory 370, and the behavior to virtual memory file 380 read datas by virtual memory 370 of the resident thread of interception.
Particularly, the file filter function that I/O blocking module 310 utilizes Windows system to provide, the resident thread of interception is write the behavior of data to virtual memory file by virtual memory 370, and the file filter function of utilizing Windows system to provide, the behavior to virtual memory file read data by virtual memory 370 of the resident thread of interception.Take pagefile.sys file as example, and when I/O blocking module 310 is intercepted while writing the request of data to pagefile.sys file, I/O blocking module 310 sends the request of data compression to internal memory compression module 320.When I/O blocking module 310 is intercepted the request to pagefile.sys file read data, I/O blocking module 310 sends the request of data decompression to internal memory decompression module 330.
Particularly, I/O blocking module 310 can be the filter Driver on FSD of exploitation.Filter Driver on FSD is a kind of driving of Windows system kernel pattern, and it relies on the I/O that already present kernel mode target drives is mail in interception to ask the additional function that provides new, and can not make bottom layer driving or user program make any change.Filter Driver on FSD interception is to the request of pagefile.sys file read-write data.Filter Driver on FSD is different from internal memory and skips.Internal memory skips and belongs to memory management, need to know that source program just can carry out.And filter Driver on FSD to provide be the subsidiary function of Windows system, filter Driver on FSD can not tackled to the request of pagefile.sys file read-write data in the situation that knowing source program.
Internal memory compression module 320 be suitable for the resident thread of I/O blocking module 310 interception by virtual memory 370 after virtual memory file 380 is write the behavior of data, data are compressed, be stored in virtual memory 370.
Particularly, internal memory compression module 320 utilizes LZO series compression algorithm that data are compressed.Internal memory compression module 320 according to I/O blocking module 310, send by the request of data compression, data are compressed, be stored in virtual memory 370.
Internal memory decompression module 330 is suitable for passing through virtual memory 370 after the behavior of virtual memory file 380 read datas at the resident thread of I/O blocking module 310 interception, and the data that are stored in virtual memory 370 are decompressed, and returns to process.
Particularly, internal memory decompression module 330 according to I/O blocking module 310, send by the request of data decompression, the data that are stored in virtual memory are decompressed, return to process.
Alternatively, device of the present invention also comprises computing module 350 and writing module 360.
Computing module 350 is suitable for the ratio of compression of computational data.The shared disk space ratio of file before the contracting of ratio of compression finger pressure and after compression.The ratio of compression of data is high, illustrates that the redundance of data is high, and the repetition rate of data is high, is applicable to compression.The data that 350 pairs of requests of computing module write to pagefile.sys file are carried out ratio of compression calculating, obtain result of calculation.Internal memory compression module 320, according to result of calculation, preferentially selects the data that ratio of compression is high to carry out subsequent compression processing.A kind of optional embodiment is, presets a threshold value, and internal memory compression module 320 is suitable for ratio of compression to compress greater than or equal to the data of setting threshold.Writing module 360 is suitable for the data lower than setting threshold by ratio of compression and writes in virtual memory file 380; The ratio of compression of data is low, illustrates that the redundance of data is low, and the repetition rate of data is low, is not suitable for compression, by being not suitable for the data virtual memory file that writes direct of compression, has avoided the problem that compression efficiency is low.
Alternatively, device of the present invention also comprises memory management module 340, and the internal memory that is suitable for utilizing Hook Function to hook up Windows system discharges function; After hooking up internal memory release function, cleaning is stored in the data in virtual memory 370.Internal memory discharges function and specifically refers to the function that Windows system is called when process is closed, as MiReleasePageFileSpace function.Under the original virtual memory extension mechanism of Windows system, apply in situation of the present invention, when process is closed, Windows system can discharge function by invoke memory.Memory management module 340 hooks up this internal memory by Hook Function (hook function) and discharges function, and as the notification message of system closing process, whether the process of utilizing Function detection that Windows system carries to go out to take virtual memory space works.Memory management module 340 is after hooking up internal memory release function, and cleaning is stored in the data in virtual memory, to complete data scrubbing.
Alternatively, memory management module 340 also can regularly be cleared up the data that certain hour is not read that surpass that are stored in virtual memory, rather than process is cleared up after closing again by the time.
The device providing according to the embodiment of the present invention, can be in current process all in work in the situation that, when shared virtual memory is excessive, avoid time waste that the frequent read-write of disk is caused, and then the system that solved is moved problem slowly.In addition, utilize the function of Windows system itself to complete interception and the release to data in virtual memory to the behavior of virtual memory file read-write data, little to existing system change, it is convenient to realize.Utilize file filter function can in the situation that not knowing source code, complete the interception to the behavior of virtual memory file read-write data.Utilize LZO series compression algorithm to compress and can further improve compression efficiency, improve the travelling speed of system.Utilizing internal memory to discharge function can discharge virtual memory useless in real time, further improves system running speed.In advance whether data are applicable to compression and judge, to being not suitable for the data of compression, directly deposit virtual memory file in, also can further improve system running speed.
The algorithm providing at this is intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with demonstration.Various general-purpose systems also can with based on using together with this teaching.According to description above, it is apparent constructing the desired structure of this type systematic.In addition, the present invention is not also for any certain programmed language.It should be understood that and can utilize various programming languages to realize content of the present invention described here, and the description of above language-specific being done is in order to disclose preferred forms of the present invention.
In the instructions that provided herein, a large amount of details have been described.Yet, can understand, embodiments of the invention can not put into practice in the situation that there is no these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand one or more in each inventive aspect, in the above in the description of exemplary embodiment of the present invention, each feature of the present invention is grouped together into single embodiment, figure or sometimes in its description.Yet, the method for the disclosure should be construed to the following intention of reflection: the present invention for required protection requires than the more feature of feature of clearly recording in each claim.Or rather, as reflected in claims below, inventive aspect is to be less than all features of disclosed single embodiment above.Therefore, claims of following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and can the module in the equipment in embodiment are adaptively changed and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and can put them into a plurality of submodules or subelement or sub-component in addition.At least some in such feature and/or process or unit are mutually repelling, and can adopt any combination to combine all processes or the unit of disclosed all features in this instructions (comprising claim, summary and the accompanying drawing followed) and disclosed any method like this or equipment.Unless clearly statement in addition, in this instructions (comprising claim, summary and the accompanying drawing followed) disclosed each feature can be by providing identical, be equal to or the alternative features of similar object replaces.
In addition, those skilled in the art can understand, although embodiment more described herein comprise some feature rather than further feature included in other embodiment, the combination of the feature of different embodiment means within scope of the present invention and forms different embodiment.For example, in the following claims, the one of any of embodiment required for protection can be used with array mode arbitrarily.
All parts embodiment of the present invention can realize with hardware, or realizes with the software module moved on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that and can use in practice microprocessor or digital signal processor (DSP) to realize according to the some or all functions of the some or all parts in virtual memory compression set in the Windows system of the embodiment of the present invention.The present invention for example can also be embodied as, for carrying out part or all equipment or device program (, computer program and computer program) of method as described herein.Realizing program of the present invention and can be stored on computer-readable medium like this, or can there is the form of one or more signal.Such signal can be downloaded and obtain from internet website, or provides on carrier signal, or provides with any other form.
It should be noted above-described embodiment the present invention will be described rather than limit the invention, and those skilled in the art can design alternative embodiment in the situation that do not depart from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and is not listed as element or step in the claims.Being positioned at word " " before element or " one " does not get rid of and has a plurality of such elements.The present invention can be by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In having enumerated the unit claim of some devices, several in these devices can be to carry out imbody by same hardware branch.The use of word first, second and C grade does not represent any order.Can be title by these word explanations.

Claims (10)

1. a virtual memory compression method in Windows system, comprising:
Resident thread in intercepting system process is write the behavior of data to virtual memory file by virtual memory, described data are compressed, and is stored in described virtual memory;
Tackle described resident thread and by virtual memory, to virtual memory file, read the behavior of described data, the described data that are stored in described virtual memory are decompressed, return to described system process.
2. method according to claim 1, wherein:
The behavior that resident thread in described intercepting system process is write data by virtual memory to virtual memory file is specially: the file filter function of utilizing Windows system to provide, and the resident thread in intercepting system process is write the behavior of data to virtual memory file by virtual memory;
The behavior that the described resident thread of described interception is read described data by virtual memory to virtual memory file is specially: the file filter function of utilizing Windows system to provide, and tackle described resident thread and by virtual memory, to virtual memory file, read the behavior of described data.
3. method according to claim 1 and 2, also comprises:
The internal memory that utilizes Hook Function to hook up Windows system discharges function;
After hooking up described internal memory release function, cleaning is stored in the described data in described virtual memory.
4. according to the method described in claim 1-3 any one, described, before being compressed, data also comprise: the ratio of compression that calculates described data;
Described data are compressed and are specially: ratio of compression is compressed greater than or equal to the data of setting threshold;
Described method also comprises: the data by ratio of compression lower than described setting threshold write in described virtual memory file.
5. according to the method described in claim 1-4 any one, described data are compressed and are specially: utilize LZO series compression algorithm that data are compressed.
6. a virtual memory compression set in Windows system, comprising:
I/O blocking module, the resident thread being suitable in intercepting system process is write the behavior of data to virtual memory file by virtual memory, and tackle described resident thread and by virtual memory, to virtual memory file, read the behavior of described data;
Internal memory compression module, be suitable for the described resident thread of described I/O blocking module interception by virtual memory after virtual memory file is write the behavior of data, described data are compressed, be stored in described virtual memory;
Internal memory decompression module, be suitable for the described resident thread of described I/O blocking module interception by virtual memory after virtual memory file is read the behavior of described data, the described data that are stored in described virtual memory are decompressed, return to described system process.
7. device according to claim 6, described I/O blocking module is specifically suitable for: the file filter function of utilizing Windows system to provide, tackle described resident thread and by virtual memory, to virtual memory file, write the behavior of data, and tackle described resident thread and by virtual memory, to virtual memory file, read the behavior of described data.
8. according to the device described in claim 6 or 7, also comprise: memory management module, the internal memory that is suitable for utilizing Hook Function to hook up Windows system discharges function; After hooking up described internal memory release function, cleaning is stored in the described data in described virtual memory.
9. according to the device described in claim 6-8 any one, also comprise:
Computing module, is suitable for calculating the ratio of compression of described data;
Writing module, is suitable for the data lower than described setting threshold by ratio of compression and writes in described virtual memory file;
Described internal memory compression module is further adapted for ratio of compression is compressed greater than or equal to the data of setting threshold.
10. according to the device described in claim 6-9 any one, described internal memory compression module is specifically suitable for: utilize LZO series compression algorithm that 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 true CN103617133A (en) 2014-03-05
CN103617133B 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)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106997316A (en) * 2017-04-11 2017-08-01 上海联彤网络通讯技术有限公司 Detecting system and method that memory abnormal increases
CN107608782A (en) * 2016-07-11 2018-01-19 阿里巴巴集团控股有限公司 The method and device of memory compression, operating system, electronic equipment
CN109254954A (en) * 2018-09-13 2019-01-22 政采云有限公司 Document handling method and device calculate equipment and storage medium
CN109445693A (en) * 2018-10-19 2019-03-08 郑州云海信息技术有限公司 A kind of data compression method and device
CN110457235A (en) * 2019-08-20 2019-11-15 Oppo广东移动通信有限公司 Memory compression methods, device, terminal and storage medium
CN113742299A (en) * 2020-05-27 2021-12-03 网神信息技术(北京)股份有限公司 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文件系统微过滤驱动模型的文件透明加解密系统的研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107608782A (en) * 2016-07-11 2018-01-19 阿里巴巴集团控股有限公司 The method and device of memory compression, operating system, electronic equipment
CN107608782B (en) * 2016-07-11 2021-01-29 斑马智行网络(香港)有限公司 Memory compression method and device, operating system and electronic equipment
CN106997316A (en) * 2017-04-11 2017-08-01 上海联彤网络通讯技术有限公司 Detecting system and method that memory abnormal increases
CN106997316B (en) * 2017-04-11 2020-02-21 上海联彤网络通讯技术有限公司 System and method for detecting abnormal increase of memory
CN109254954A (en) * 2018-09-13 2019-01-22 政采云有限公司 Document handling method and device calculate equipment and storage medium
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
CN110457235A (en) * 2019-08-20 2019-11-15 Oppo广东移动通信有限公司 Memory compression methods, device, terminal and storage medium
CN110457235B (en) * 2019-08-20 2021-10-08 Oppo广东移动通信有限公司 Memory compression method, device, terminal and storage medium
CN113742299A (en) * 2020-05-27 2021-12-03 网神信息技术(北京)股份有限公司 File compression and decompression method and file compression and decompression device
CN113742299B (en) * 2020-05-27 2024-01-02 奇安信网神信息技术(北京)股份有限公司 File compression and decompression method and file compression and decompression device

Also Published As

Publication number Publication date
CN103617133B (en) 2017-08-25

Similar Documents

Publication Publication Date Title
US20230244395A1 (en) Virtual disk storage techniques
US9671967B2 (en) Method and system for implementing a distributed operations log
US9058123B2 (en) Systems, methods, and interfaces for adaptive persistence
US8996468B1 (en) Block status mapping system for reducing virtual machine backup storage
US8239648B2 (en) Reclamation of thin provisioned disk storage
US9298377B2 (en) Techniques for reducing read I/O latency in virtual machines
US9081702B2 (en) Working set swapping using a sequentially ordered swap file
CN103617133A (en) Method and device for compressing virtual memory in Windows system
US10353636B2 (en) Write filter with dynamically expandable overlay
KR102443600B1 (en) hybrid memory system
US20200133875A1 (en) Method, apparatus and computer program product for managing data access
KR20200121372A (en) Hybrid memory system
CN104685443A (en) Pinning boot data for faster boot
JP6680069B2 (en) Storage control device, storage system, and storage device control program
CN102968323A (en) Computer terminal and method for accelerating starting-up of computer system
CN104615383A (en) Software operation method and device based on virtual disk
TW202018500A (en) Saving and restoring machine state between multiple executions of an instruction
KR20200117032A (en) Hybrid memory system
CN102968324B (en) The method for sorting of computer system power-on file and device
US10628317B1 (en) System and method for caching data in a virtual storage environment based on the clustering of related data blocks
KR101834082B1 (en) Apparatus and method of managing multi solid state disk system
KR20190069134A (en) Apparatus and method for file sharing between applications
CN117453345A (en) Method, equipment and medium for optimizing VDI file read-write based on file filtering drive
CN116755630A (en) Method, system, equipment and storage medium for optimizing input and output performance
WO2019221890A1 (en) Pinning in a multi-tiered system

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