Author Topic: Autopatcher deals with Huge Files  (Read 4526 times)

DeepSea

  • Not-a-newbie
  • *
  • Posts: 23
  • Karma: 1
    • View Profile
Autopatcher deals with Huge Files
« on: May 22, 2009, 10:22:21 PM »
Hi
In our project,everything is packed into a couple of resource files.
when we use the patch module that RakNet provided to patch a huge resource file (700M),it simply crashes.I checked the orginal author's page for this problem.it says:
bsdiff is quite memory-hungry. It requires max(17*n,9*n+m)+O(1) bytes of memory, where n is the size of the old file and m is the size of the new file. bspatch requires n+m+O(1) bytes.
The reason is obvious,everytime the program read all the files it needs to the memory.It is NOT reasonable when the patcher needs 2G+ memory whereas the Game just requires 512M.
Any enhancement or suggestions?

Thanks

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: Autopatcher deals with Huge Files
« Reply #1 on: May 25, 2009, 08:36:49 PM »
I imagine it would be slow as well to patch a file that large. I don't know of any alternative open source code to do diffs and patching though. All I can suggest for now is to split up your files, or find a commercial application just for patching.  I've heard of RTPatch before http://www.pocketsoft.com/

DeepSea

  • Not-a-newbie
  • *
  • Posts: 23
  • Karma: 1
    • View Profile
Re: Autopatcher deals with Huge Files
« Reply #2 on: May 27, 2009, 01:56:39 AM »
thanks for the reply.
I did some research on patching system.Now I have "dup"(it just provides the ASM source code  for search & replace module),http://diablo2oo2.di.funpic.de/dup.htm
Xdelta code.google.com/p/xdelta/
The problem is Xdelta generates a huge patch file like 560M when i tried on old file(550M)diff with new file(580M),but the it doesnt have any memory "issues",(the mermory cosumption stays at 150M roughly.)
I think it may be better when we could bind the search&replace engine from dup with the current bsdiff.or We need to change the patch system on file basis not memory basis.

Thanks


Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: Autopatcher deals with Huge Files
« Reply #3 on: May 27, 2009, 09:09:40 AM »
ASM isn't sufficient to integrate into RakNet. You might use that engine for your own project though.