Benthic foraminifera, heavy metals, and sediment grain sizes were studied in three bays of Hainan Island, and canonical correspondence analysis (CCA) and nonparametric regression were used to reveal the relationship between foraminifera and their environment. According to our survey, the three bays were moderately contaminated by Mo and As and uncontaminated to moderately contaminated by Pb, Zn, Cr, Sb, and Hg. The spatial pattern of heavy metals was comparable to sediment transport trends, indicating that their distribution was determined by sediment transport. Both living and dead foraminiferal assemblages were analyzed, and their compositions were similar, although the latter had a higher density and diversity. Based on the CCA method, species were divided into three groups, each of which responded differently to heavy metals and grain sizes. The response curves of individual species to heavy metals and grain sizes were obtained by using the Loess (locally weighted regression) method.