Pregnancy and weight gain are like peanut butter and jelly — they go hand-in-hand.

Expectant mothers are supposed to gain weight during the gestational period.

Anywhere from 25 to 30 pounds is the recommended amount.

Anything more and the mother and baby can develop health risks, both moderate and severe.

But what about if the mother is already overweight or obese when she gets pregnant?

What effect does a have on the overall health of mothers and babies during pregnancy?

Equally important — what about later in life?

Read more: Common concerns during pregnancy »

Studying weight gain

One recent study looked at the issue of weight gain and pregnancy and the means to tackle the health problems that obesity brings.

Researchers, led by Dr. Tammy Chang, MPH, assistant professor in the department of family medicine at the University of Michigan Medical School, looked at the medical records of 1,000 women.

The research team used information from the Fragile Families and Child Wellbeing Study, a joint effort by Princeton and Columbia universities.

The patients were young women ages 15 to 24 with a median age of 21. About one-third were African-American, and roughly 40 percent were Latina.

Almost half reported income under the Federal Poverty Level (FPL). Approximately 45 percent were obese before they became pregnant, while 55 percent gained more than the recommended weight during pregnancy.

The researchers surmised that a high pre-pregnancy BMI often results is excess weight gain during pregnancy.

In turn, that weight gain — before and during pregnancy — is likely to continue for the mother and for the baby throughout their lifespans.

But the study also suggested that this specific age group is receptive to purposeful health education.

The authors strongly encouraged doctors who treat pregnant adolescents to take that opportunity to stop the slippery slope of obesity.

Using a patient’s pre-pregnancy BMI as a starting point for healthy lifestyle choices will not only influence the mother’s attitude about eating well, it can have an impact on the baby as well.

“If we can help a mom achieve a healthy weight gain — not too much and not too little — then we can influence two generations,” Chang told Healthline.

Read more: Nutritional needs during pregnancy »

The dangers of obesity

More than one-third of adults living in the United States are considered obese, according to the from 2014. In children that rate hovers around 20 percent.

Being obese is deemed by your BMI. If your BMI registers at above 30 percent, you are considered obese.

The American Congress of Obstetricians and Gynecologists (ACOG) states that obesity during pregnancy exposes the mother to serious health risks, including preeclampsia, high blood pressure, gestational diabetes, and sleep apnea.

For the infant, an obese mother means a higher risk of birth defects, macrosomia (large birth weight), and preterm birth complications, among other issues.

Dr. Sina Haeri, director of perinatal research, and co-director of maternal fetal medicine at St. David’s Women’s Center of Texas, said these types of studies do an excellent job of reinforcing what many doctors are striving for in their patients — maintaining optimum health for both mother and baby.

Haeri, who has conducted extensive research on teenage pregnancy, said a pregnant woman who starts out obese will end up with a baby that is either too small or too large. He defined that as a baby that weighs either below the 10th percentile or above the 90th percentile of the desired weight range for an infant.

But poor diet choices while a mother is pregnant will continue to influence their baby long after delivery, he added.

If the mother doesn’t dramatically change her diet, the daily intake of poor nutrition choices can ultimately “hard wire” the infants brain into thinking that is a normal way to eat.

“If you have a poor diet while you’re pregnant, your baby will be programmed to overeat as well,” he said.

Read more: Healthy diet during pregnancy »

Solutions aren’t that easy

For young women who become pregnant, eating healthy isn’t always easy.

Haeri noted that the majority of teens and young women who become pregnant live in poverty or in lower socioeconomic margins.

Many reside in food desserts, where stores with fresh fruits and vegetables don’t exist. Many don’t have easy access to transportation, or have other children they must care for.

“You have to keep in mind the socioeconomic aspect,” he said. “A healthier diet is more expensive.”

That’s why the clinic where Chang works, The Corner Health Center, also houses a store stocked with healthy foods. This makes it easier for her patients to make good food choices and keep their weight down, she added.

“We want to be one-stop-shopping,” Chang said. “We want to set up young moms for success. They are just trying to make it through the day.”

She said pregnancy is the best time to introduce healthy eating habits because women are “supermotivated” by their unborn child.

That drive is necessary when someone is trying to lose weight, she added. The cycle of obesity is hard to break.

“People quit smoking [during pregnancy],” she said. “It’s the golden time.