This warning is thrown by the target when Simulink downloads the signals that must be logged. There are a few reasons why this might be thrown.
One of them is that the duration is large and the target is trying to allocating too much memory based on the size of the duration. There is no upper limit to the duration, it is dependent on how much memory a target has. For a PC, the duration can be huge. For embedded targets, it depends entirely on how much memory can be allocated.
It is possible the duration is set to a reasonable size for the target and this warning is still thrown. If there are many, many signals being logged, then the amount of memory being allocated may be too much even though the duration is small. So another possible solution is to decrease the number of signals being logged.