Reply to thread

Started on: 2023-12-26

last update: 2023-12-26


Summary:

Minimize the amount of data written to disk by simulating a tempfs RAM disk on Windows via file open attributes

  • FILE_ATTRIBUTE_TEMPORARY
  • FILE_FLAG_DELETE_ON_CLOSE


Area:

TVServer


Description:

Time shift files are just used temporary. As they can take quite some space, virtual memory (im my case 16 GB RAM + 32 GB swapfile) is most likely to small. So they have to be written on disk (current situation). Windows can "simulate a RAM disk" by opening/creating the time shift files with the attributes

  • FILE_ATTRIBUTE_TEMPORARY
  • FILE_FLAG_DELETE_ON_CLOSE

Such files are written to disk only if necessary (Windows and its memory management take care of it).


The advantage is that the disk/SSD has less written data and thus less wear and less power consumption.


I don't know whether this flags are available from C#. I don't know how the flags behave when the file is opened multiple times (TVServer writing it and TVServer reading it (RTSP) or MediaPortal client reading it).


[URL unfurl="true"]https://en.wikipedia.org/wiki/List_of_RAM_drive_software#Native[/URL]


I don't know the MediaPortal source code, so usage of this flags might be already the case.


Top Bottom