I was referring to the Instant jqGrid book to set up the grid. The noOfPages attribute is calculated as follows.
//Prepare the response
$numberOfPages = ceil( $numberOfRows / $rowsPerPage );
I could see that for 581 records with rowPerPage=25, the noOfPages were appearing as 23.
System.out.println((int)Math.ceil(581/25));//23
I was expecting a value as 24 with the last page containing the records [576-581]. So here, we are missing these 6 records.