You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since #1067, memory sizes are no longer specified as integers, but with units, and they have a proper type in QLever.
However, that change gave rise to an error that did not occur before (or went unnoticed). Namely, when the size of the pinned queries is larger than CACHE_MAX_SIZE, then any further query results in the following error message:
Underflow error: Subtraction of the two given 'MemorySize's is not possible. It would result in a size_t underflow.
There are two possible fixes (and maybe it makes sense to do both):
Don't allow pinning of a query when the total size of the pinned queries would then exceed CACHE_MAX_SIZE. This would also be consistent with the fact that it is already not allowed now that a query is pinned, the size of which exceeds CACHE_MAX_SIZE_SINGLE_ENTRY.
Catch the underflow error above and return a proper error message (something along the lines of: no memory left; we already have such a message in other places).
Alright, I took a look and found the only line, which could be responsible for this error in src/util/Cache.h:343:
if (_maxSize - _totalSizePinned < sizeToMakeRoomFor) {
returnfalse;
}
I'm definitely for the first solution (Don't allow pinning of a query when the total size of the pinned queries would then exceed CACHE_MAX_SIZE.) and I was under the impression, that this was already the case.
After all, the documentation of the FlexibleCache says:
@brief Associative array for almost arbitrary keys and values that acts as a cache with fixed memory capacity.
What would be the point of a cache with a maximum capacity, if the maximum capacity is ignored?
Since #1067, memory sizes are no longer specified as integers, but with units, and they have a proper type in QLever.
However, that change gave rise to an error that did not occur before (or went unnoticed). Namely, when the size of the pinned queries is larger than
CACHE_MAX_SIZE
, then any further query results in the following error message:There are two possible fixes (and maybe it makes sense to do both):
Don't allow pinning of a query when the total size of the pinned queries would then exceed
CACHE_MAX_SIZE
. This would also be consistent with the fact that it is already not allowed now that a query is pinned, the size of which exceedsCACHE_MAX_SIZE_SINGLE_ENTRY
.Catch the underflow error above and return a proper error message (something along the lines of: no memory left; we already have such a message in other places).
@schlegan @joka921 Can you have a look and what do you think?
The text was updated successfully, but these errors were encountered: