Description
Hello. I'm trying to run a benchmark on an embedded system. The system is qemu-system-arm -machine mps2-an386 with 16MB RAM. It works, but I'm facing the following issue: during the measure_environment process, specifically in estimate_clock_resolution, it consumes all my available RAM and throws the std::bad_alloc exception.
The problem is that estimate_clock_resolution is only limited by time. At the same time, this is a hard-coded clock_resolution_estimation_time limit of 500ms and this cannot be configured without modifying the source code. It may be worth adding a limit on the number of iterations or allowing it to be configured. Alternatively, it may be possible to configure the time limit.
I suggest adding the ability to limit the number of iterations or the time limit using command-line parameters, similar to --benchmark-warmup-time e.g. --benchmark-estimate-clock-time.
Additional context
During the measure_environment process, the number of iterations reached 1'280'000, which resulted in the allocation of 1'280'000 std::vector<TimePoint<Clock>> type elements in std::vector<TimePoint<Clock>> times(points) and 1'280'001 double type elements in std::vector<double> deltas.

Description
Hello. I'm trying to run a benchmark on an embedded system. The system is
qemu-system-arm -machine mps2-an386with 16MB RAM. It works, but I'm facing the following issue: during themeasure_environmentprocess, specifically inestimate_clock_resolution, it consumes all my available RAM and throws thestd::bad_allocexception.The problem is that
estimate_clock_resolutionis only limited by time. At the same time, this is a hard-codedclock_resolution_estimation_timelimit of 500ms and this cannot be configured without modifying the source code. It may be worth adding a limit on the number of iterations or allowing it to be configured. Alternatively, it may be possible to configure the time limit.I suggest adding the ability to limit the number of iterations or the time limit using command-line parameters, similar to
--benchmark-warmup-timee.g.--benchmark-estimate-clock-time.Additional context
During the
measure_environmentprocess, the number of iterations reached 1'280'000, which resulted in the allocation of 1'280'000std::vector<TimePoint<Clock>>type elements instd::vector<TimePoint<Clock>> times(points)and 1'280'001doubletype elements instd::vector<double> deltas.