Here's something to keep in mind if you are looking for a way to prevent chronic disease: magnesium. It's surprising that so many people are deficient in this mineral, since it's found in many foods. It's time to think about whether you get enough.

People who have the most magnesium in their diets are less likely to develop heart disease, less likely to have a stroke and less likely to develop type 2 diabetes compared to people who have the least. This is the finding of a review of over 40 studies conducted over 17 years.

If your diet includes plenty of leafy green vegetables, beans, nuts and whole grains, you likely have enough magnesium. An ounce of dark chocolate (70 to 85% cocoa) can also help.

More is even better. If you eat an extra 100 milligrams of magnesium every day — less than a cup of chard or about three-quarters of a cup of black beans — you could decrease your risk of having a stroke by another 7% and cut the chances of developing type 2 diabetes by almost 20 percent.

“Low levels of magnesium in the body have been associated with a range of diseases but no conclusive evidence has been put forward on the link between dietary magnesium and health risks,” said Fudi Wang, lead author of the study, in a statement. “Our meta-analysis provides the most up-to-date evidence supporting a link between the role of magnesium in food and reducing the risk of disease.”

By some estimates, 80% of the American population does not get enough magnesium. The RDA — Recommended Dietary Allowance — for magnesium in adults 19 to 30 years old is 400 milligrams for males and 310 milligrams for females. That amount increases to 420 milligrams and 320 milligrams respectively after the age of 30. The majority of Americans of all ages consume less magnesium than this with men over 70 years and teenaged girls most likely to have insufficient intakes.

Magnesium is vital to the proper functioning of more than 300 biochemical reactions in the body. It is important for glucose metabolism, protein synthesis, bone development, proper conduction of nerve impulses, muscle contraction and maintaining a normal heart rhythm.

If your diet includes plenty of leafy green vegetables, beans, nuts and whole grains, your magnesium status is likely good. For example, one cup of spinach provides 160 milligrams, while one cup of quinoa has 118 milligrams. One cup of black beans will give you 120 milligrams, while an ounce of almonds has 260 milligrams. If you don’t regularly eat these foods, you might want to consider ways to incorporate more of them in your diet.

Cocoa is also a good source of magnesium, but depending on sugary, fatty chocolate to meet your magnesium needs is likely to tip the scale in a way that’s not good for your health. An ounce of dark chocolate (70 to 85% cocoa) can help you meet your need for magnesium.

Though the studies in the review can't directly link magnesium deficiency to a reduced risk of disease — other lifestyle and biological factors could be at play — the authors believe the findings are strong enough that policymakers should consider magnesium deficiency and associated health risks when developing dietary guidelines.

The study is published in BMC Medicine.