The U.S. Navy has eliminated fried food and sugary drinks on its ships. It is keeping base gyms and fitness centers open all night. But its sailors keep getting fatter: A new Defense Department study found that 22 percent of them — roughly 1 in every 5 — now qualifies as obese.

The Navy’s figure is the highest, but the study found striking rises in obesity rates in the other armed services as well, even though the Pentagon has rolled out one strategy after another in recent years to try to keep the troops trim. And the increases have military leaders worried.

“Obesity negatively impacts physical performance and military readiness and is associated with long-term health problems such as hypertension, diabetes, coronary heart disease, stroke, cancer, and risk for all-cause mortality,” the study’s authors wrote in the August issue of the Defense Department’s Medical Surveillance Monthly Report, where the data was first published.

The study used the body mass index, a simple, widely known metric that is calculated from height and weight measurements, which the military stores in its vast electronic health database. Using 2018 data, all troops who scored higher than 30 on the index were considered obese.

The Marine Corps, which has the youngest force and maintains the toughest physical fitness standards, was the leanest in the study, with 8.3 percent of Marines over the obesity threshold. The Army came in at 17.4 percent — the same as the military-wide average — and the Air Force was at 18.1 percent.

The authors cautioned that body mass index is not a perfect yardstick. It can be thrown off by extremely fit troops who score high because they have a lot of lean muscle, rather than a lot of fat. But even so, the study showed a clear trend: The obesity rate of all the military branches has been rising steadily.

A decade ago, when the military began to see weight as a growing problem, it started deploying countermeasures. Gym hours at bases were expanded. More unitwide workouts were scheduled. French fries were curtailed in the mess halls.

But the problem has only worsened. In 2011, only 6.4 percent of the Army, 9 percent of the Air Force and 2.3percent of the Marine Corps was obese, according to Defense Department health data. In less than a decade, the rates in those branches have more than doubled — and in the Navy, obesity has risen sixfold.

Military leaders once had the opposite problem. During World War II, recruiters and draft boards were flooded with undernourished candidates who were too puny to qualify for service. After the war, generals urged the federal government to create a school lunch program as a matter of national security.

Today, about one-third of potential recruits are too heavy to enlist. And many recruits who are trim when they get to boot camp gain weight once they have access to Uncle Sam’s all-you-can-eat base dining facilities.

Experts say the trend mirrors the growth of American civilian waistlines — though the civilian obesity rate is more than twice as high, at nearly 40percent of adults, according to the most recent figures from the Centers for Disease Control and Prevention.

“The Department of Defense is a microcosm of the nation — we recruit from the nation,” said Laura Mitvalsky, the director of health promotion and wellness at the Army Public Health Center. “So the nation’s problems are ours as well.”

The Navy’s obesity rate was not helped in recent years when the service decided to retain thousands of overweight sailors because they were valuable to Navy operations.

Increasingly, the military is shifting its focus away from trying to get individuals to lose weight and toward a servicewide public health approach that commanders hope will keep the force slim, Mitvalsky said. The military has enormous control over what troops are given to eat and where they shop, so it has the power to erect what Mitvalsky called a “healthy choice architecture” that goes far beyond what could be imposed in civilian life.

Chow halls across the military now have color-coded labels. The Marine Corps version is called “Fueled to fight.” While troops can eat what they want, healthy foods, including fruits, vegetables and whole grains get a green label for “engage at will.” Fatty junk foods get a red label for “check fire.” Foods that should only be consumed occasionally are labeled yellow for “well-aimed shots.”

Ultimately, Mitvalsky said, fitness comes down to individual choice, but the military can push the choices it desires. “We want the healthy choice to be the easy choice,” she said.

Even so, change in the nation’s largest bureaucracy comes slow, and U.S. military bases around the world still dish out plenty of traditionally heavy Department of Defense red-label chow.

On Wednesday, the galley at Naval Base San Diego featured beef potpie. Thursday there will be turkey a la king, and on Friday, chili conquistador.