写注册表永久保存之后,系统性能变慢的解决

来源:互联网 发布:miui9卸载预装软件 编辑:程序博客网 时间:2024/05/16 10:41

http://blog.csdn.net/shuiii/archive/2007/04/27/1587330.aspx--------------作者比较厉害,SD卡等都有涉及

注册表永久保存终于是搞定了,但新的问题又来了。由于注册表保存在nandflash,每次修改注册表都会去读写nandflash,播放视频时,对会写入很多新的注册表键值,每次读写nandflash来保存这些键值会造成很多CPU资源的浪费,所以每次刚开始播放都会有停顿的现象。

解决:修改注册表platform.reg

[HKEY_LOCAL_MACHINE/init/BootVars]
   "SystemHive"="system.hv"
  "DefaultUser"="default"
  "Flags"=dword:3
  "RegistryFlags"=dword:1

--------------------------------------------------------------------------------

"RegistryFlags"=dword:1改成dword:0,不用每次注册表修改就自动去flush注册表。

--------------------------------------

设置环境变量  SET  PRJ_ENABLE_REGFLUSH_THREAD=1

IF PRJ_ENABLE_REGFLUSH_THREAD
[HKEY_LOCAL_MACHINE/System/ObjectStore/RegFlush]
; To monitor the flushing from an external process add "ActivityName" registry value.
; The activity name is a global named event that filesystem will signal on Registry Activity.
;   "ActivityName"=""
; Create an thread in filesys to perform flushing
    "SpawnThread"=dword:1
; Make the thread IDLE priority
    "FlushPriority256"=dword:FF
; ActivityThreshold specifies the # of reg activity before we force a flush
    "ActivityThreshold"=dword:100
; Timeout period for a flush (flush occurs if there have been some changes during this period)
    "FlushPeriod"=dword:3E8
ENDIF

-----------------------------------------------------------------------------------------------------------------------

让系统在一个周期内都flush注册表。"FlushPeriod"=dword:3E8 默认设置为1秒钟。

原创粉丝点击