How to keep command line mode going

Help
2005-05-30
2012-12-07
  • I have some big ISO files to compress, so I wrote a batch file to compress them in Windows XP.
    The batch file (I named it 7z_batch.bat) is like this:

    D:\Tools\7-ZIP\7za a -t7z cfe-lcpeta.7z cfe-lcpeta.iso -mx=9 >>d:\log.txt
    ...

    But I found a problem:
    After I run it for a while , the CPU usage will drop down to 10-20% from 90-100% at the begining.
    Then, the size of the target file (cfe-lcpeta.7z) stop increase, but before that it increase fast.

    So, I think maybe Windows XP make the 7za.exe process idle. But after I set it's priority to High in Task Manager, it still doesn't work.

    Can anyone help me please?

     
    • shawn8888
      shawn8888
      2005-05-30

      BTW, I tried 7z.exe and 7za.exe. Both of them are the same.
      Also, I tried to set my virture memory size to 2GB, still doesn't work. (My PC's RAM is 256MB)

       
    • The mode you're using requires over 300 MB of memory.  You are going to be paging wildly and things are going to slow to a crawl.  Use -mx=7 (memory usage of 84 MB) and things should remain nice and fast.

       
    • shawn8888
      shawn8888
      2005-05-31

      But I really want to set the compress mode to maximum.

      I tried it on another machine, which has 512MB memory, but still very slow.

      I don't understand why it's fast at the begining and slow down for no reason. Is it a bug or not optimize well?

       
    • What happens is that the dictionary is built incrementally.  At the beginning this happens quickly because there is enough RAM to hold the dictionary (and other structures).  At some point the dictionary and the other stuff become too large to fit in RAM, and your machine starts using disk space as working memory.  If you use NT, 2000, XP, or 2003 you can use Task Manager to actually watch this happen.

      Keep in mind that not only does your 256 MB (or 512 MB) have to store what 7-Zip is using, but also the operating system, drivers, things that are running in the background, etc.

      RAM bandwith is on the order of GB/s.  Disk bandwith is on the order of MB/s.

       
    • shawn8888
      shawn8888
      2005-06-01

      Is what you are saying that add RAM is the only solution if I want to use -mx=7?
      There's nothing I can do about it?
      Since the RAM can hold all 7-zip reqires at the begining, why it can not hold it after ? Is it because XP is stupid in managing RAM?

       
    • shawn8888
      shawn8888
      2005-06-01

      sorry, it's a typo: "if I want to use -mx=9"

       
    • Yes, the only solution is to add more RAM, or resign yourself to waiting.

      At the beginning of the process 7-Zip needs only a little.  After a while it needs _a lot_.  How much depends on the maximum size that you specify with the options.  That's the way dictionary based compressors work.   It has nothing to do with XP's memory managment.  No OS can give a program 300 MB of RAM if all you have is 256.

       
    • Try -mx7 -md=16m Use "only" 160 MB of RAM.

       
    • Dear  Shawn8888,

      Since you want to use -mx=9, you should allow that to run to completion, i.e. let it use the very, very slow virtual memory (your disk) and see what you get for file size.

      Then try the above algorithm (-mx7 -md=16m) and see what the difference is.

      I don't think it will be that different, but then you can make up your mind just how long you're willing to wait to get that -mx9 result.

      Of course, shutting down other programs will release memory for your task.

      Good luck.
      tja

       
    • shawn8888
      shawn8888
      2005-06-02

      " -mx7 -md=16m " ?
      I want to use -mx=9 to compress my files as small as possible.
      If I set -md=16m, will it results in bigger size or slower speed?

       
    • shawn8888
      shawn8888
      2005-06-02

      Thank you tja!
      I think I will try your method later.