This can be solve only if you increase the amount of memory in your server. You are facing this error because your server/setup is not having sufficient memory. Your configuration should be really robust and capable of handling the database size.
Remember qlikview is a In-Memory analysis tool, so everything is on your RAM.
Another thing with 18 dimensions and 5 expressions definitely you will get performance issues. I hope your expressions does not have set analysis too.
Could it be you have a big pivot table or other chart with lots of calculations? I sure hade several similar issues with data rows only of several thousand but out of memory error in a chart with dozens of expressions and calculations ...
1. Make sure you have no synthetic keys in the data model (Ctrl + T)
2. If you have calculated dimensions, make sure they are not complex or even eliminate them by different solution
3. Disable all expressions. Enable them one bu one to determine if there is a specific expression that causes your problem.
4. Minimize usage of nested IF statements in your expressions.
5. If possible precalculate values in your script instead of in application objects, to decrease memory and CPU usage during runtime