disParity » General Discussion

Feature Request: custom memory buffer file size

(7 posts)
  1. freehand
    Member

    Awesome work with the beta! Anything to make disparity more reliable.

    One feature request I have is to make the in memory buffer file size configurable. Most of my files are around 1GB and I have lots of RAM to use a temporary location.

    What would this involve? Also what is the default file size right now?

    Posted 5 years ago #
  2. Roland
    Roland

    Currently the maximum file size for which disParity will use the in-memory buffer is 1024 64K blocks, or 64MB.

    It could be made configurable easily enough. The only thing I worry about would be people setting it too high and causing problems for their system, although the maximum it could be set to is 2GB (without me rewriting the current temp buffer implementation some other way, I mean.)

    Posted 5 years ago #
  3. klim
    Member

    what about of setting the buffer dynamically at 50% of free ram and checking it at :
    each file/some files/a few sec/once per action

    Posted 5 years ago #
  4. Roland
    Roland

    I know from past experience that it can be really tricky to get things like that to work correctly. Memory management under Windows has some subtle issues and no matter how smart you make it, there will always be some systems out there with strange behavior. I think a fixed buffer size under direct control of the user is probably the best way to go.

    Posted 5 years ago #
  5. klim
    Member

    u're the master, so u write the rules

    Posted 5 years ago #
  6. Roland
    Roland

    Actually when I said "fixed buffer size" I should really have said "max buffer size". disParity only allocates as much memory as it needs to actually process the current file.

    I'm currently testing a change that allows the user to set the max buffer size. Update performance definitely improves quite a bit when you set the limit to be much higher than the default of 64MB.

    Posted 5 years ago #
  7. Roland
    Roland

    More info on this: I forgot that the 2GB limit is actually a hard limit imposed by Windows. 32-bit applications like disParity can never allocate more than 2GB of RAM (no matter how much RAM on the system), and the practical limit is quite a bit lower than that since part of the address space is reserved for other things like code and the stack. In practice I'm finding that allocations larger than about 1.5GB will fail, so the practical limit on the size of the in-memory temp buffer is going to be about 1.5GB. I've coded it so that if the allocation fails, disParity will fall back to the on-disk temp file silently, so the update won't be affected.

    Posted 5 years ago #

RSS feed for this topic

Reply

You must log in to post.