Working with MEMORY_FILE

Doubts, help and support about QuickBMS and other game research tools
Mumm-Ra
Posts: 3
Joined: Wed Sep 16, 2020 2:08 pm

Working with MEMORY_FILE

Post by Mumm-Ra »

Hello, i was trying to write some code that uses MEMORY_FILE as a buffer and write that buffer to the output file, clear it and use it again and again. I was trying to clear MEMORY_FILE after each write, didn't found any info regarding how to do (maybe it's not possible, don't know).
Could somebody give some help?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Working with MEMORY_FILE

Post by aluigi »

log MEMORY_FILE 0 0
Mumm-Ra
Posts: 3
Joined: Wed Sep 16, 2020 2:08 pm

Re: Working with MEMORY_FILE

Post by Mumm-Ra »

aluigi wrote:log MEMORY_FILE 0 0

Thank you for the reply, that's what i've tried for first. The strange thing is that the memory_file size keep increasing, seems the command has no effect.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Working with MEMORY_FILE

Post by aluigi »

Are you sure you don't have the "append" mode left enabled?

The size of the MEMORY_FILE in memory is not touched after reset because it's left as buffer for possible future operations, in this case it improves the performances by avoiding to reallocate it multiple times.
So if you still see quickbms.exe keeping lot of memory after "log MEMORY_FILE 0 0" that's normal :)
Mumm-Ra
Posts: 3
Joined: Wed Sep 16, 2020 2:08 pm

Re: Working with MEMORY_FILE

Post by Mumm-Ra »

aluigi wrote:Are you sure you don't have the "append" mode left enabled?

The size of the MEMORY_FILE in memory is not touched after reset because it's left as buffer for possible future operations, in this case it improves the performances by avoiding to reallocate it multiple times.
So if you still see quickbms.exe keeping lot of memory after "log MEMORY_FILE 0 0" that's normal :)


Now that you mentioned, i think i've used append at the beggining, let me check. Thank you, you did a great tool man!