thomasmoelhave / tpie

Templated Portable I/O Environment
Other
112 stars 24 forks source link

internal data structures memory limit #237

Closed gijsde1ste closed 4 years ago

gijsde1ste commented 4 years ago

Hi all,

I'm using tpie to implement an experiment that tests the speed of internal memory algorithms vs external. I thought one of tpie features was limitting the available ram so it is easier to create a test scenario where the data set is much larger than the available ram and complete the tests in a reasonable time frame. Default OS behaviour when a data structure becomes bigger than the ram is to use swap memory, as I understand it that simply swaps out parts of ram to disk and loads it back in when necessary. I don't see such a mechanism in tpie, if I create an internal stack that doesn't fit in the available ram it just warns me that it is using too much but continues anyway without using swap memory. This is not desirable for my experiment since the entire idea is that the internal memory algorithms will slow down as soon as the memory is full and I/Os are used. Is there anyway to get tpie to enforce the memory limit and use the swap mechanic? I've checked the internal data structure implementations and the memory manager but wasn't able to find anything.

antialize commented 4 years ago

TPIE does not support anything more than what your OS does. So we cannot swap out before the OS runs out of memory. To run tests within a ensonable timeframe, you could possible run them within a VM with little assigned memory.

Back when I did the sort of experiments that needed these kinds of measurements, i would reboot my machine and pass "mem=256M" as a boot parameter to the linux kernel. I would then run the test on the machine in that configuration, back then it was possible to boot the machine in a lower run level so I would not get an X server and all kinds of other stuff. I supposed stuff like that can still be done with systemd.