In recent times, the Internet of Medical Things (IoMT) is a new loomed technology, which has been deliberated as a promising technology designed for various and broadly connected networks. In an intelligent healthcare system, the framework of IoMT observes the health circumstances of the patients dynamically and responds to backings their needs, which helps detect the symptoms of critical rare body conditions based on the data collected. Metaheuristic algorithms have proven effective, robust, and efficient in deciphering real-world optimization, clustering, forecasting, classification, and other engineering problems. The emergence of extraordinary, very large-scale data being generated from various sources such as the web, sensors, and social media has led the world to the era of big data. Big data poses a new contest to metaheuristic algorithms. So, this research work presents the metaheuristic optimization algorithm for big data analysis in the IoMT using gravitational search optimization algorithm (GSOA) and reflective belief network with convolutional neural networks (DBN-CNNs). Here the data optimization has been carried out using GSOA for the collected input data. The input data were collected for the diabetes prediction with cardiac risk prediction based on the damage in blood vessels and cardiac nerves. Collected data have been classified to predict abnormal and normal diabetes range, and based on this range, the risk for a cardiac attack has been predicted using SVM. The performance analysis is made to reveal that GSOA-DBN_CNN performs well in predicting diseases. The simulation results illustrate that the GSOA-DBN_CNN model used for prediction improves accuracy, precision, recall, F1-score, and PSNR.