Skip to content

Commit

Permalink
int overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yanhuqing666 committed Apr 18, 2019
1 parent e9cfd0c commit 613c839
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/actiontech/dble/DbleServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public void startup() throws IOException {
short bufferPoolPageNumber = system.getBufferPoolPageNumber();
//minimum allocation unit
short bufferPoolChunkSize = system.getBufferPoolChunkSize();
if (bufferPoolPageSize * bufferPoolPageNumber > Platform.getMaxDirectMemory()) {
if ((long) bufferPoolPageSize * (long) bufferPoolPageNumber > Platform.getMaxDirectMemory()) {
throw new IOException("Direct BufferPool size[bufferPoolPageSize(" + bufferPoolPageSize + ")*bufferPoolPageNumber(" + bufferPoolPageNumber + ")] lager than MaxDirectMemory[" + Platform.getMaxDirectMemory() + "]");
}
bufferPool = new DirectByteBufferPool(bufferPoolPageSize, bufferPoolChunkSize, bufferPoolPageNumber);
Expand Down

0 comments on commit 613c839

Please sign in to comment.