Inclusion Criteria:  Women and men of reproductive potential should agree to use an appropriate method of birth control throughout their participation in this study due to the teratogenic potential of the therapy utilized in this trial. Appropriate methods of birth control include abstinence, oral contraceptives, implantable hormonal contraceptives or double barrier method (diaphragm plus condom) Diagnosis of advanced cancer Patient-reported 2-month weight loss of at least 5 pounds (2.3 kilograms) and/or physician-estimated caloric intake of less than 20 calories/kilogram of body weight per day The patient must perceive loss of appetite and/or weight as a problem; and have an appetite score of 4 or worse on the "Please rate your appetite…." question that requires a patient response on a 0-10 numeric rating scale Not receiving ongoing tube feedings or parenteral nutrition at the time of registration Not currently using systemic adrenal steroids (with the exception of short-term dexamethasone within 3 days of chemotherapy for control of chemotherapy side effects) No use of androgens, progesterone analogs, or other appetite stimulants within the past month Patient should not have poorly controlled hypertension or congestive heart failure at registration Patient should not have an obstruction of the alimentary canal, malabsorption, or intractable vomiting (defined as vomiting more than 3 times per day over the preceding week) Not currently using olanzapine for another medical condition or had previously used olanzapine for chronic nausea or for any pre-existing psychotic disorder Patient should not have had a previous blood clot at any time in the past No history of poorly controlled diabetes No symptomatic leptomeningeal disease or known brain metastases as these patients may have difficulty taking oral medications No history of hypersensitivity to olanzapine or megestrol acetate No COVID-19 infection in the past that, in the opinion of the treating physician, had left patients with compromised taste, which has not resolved at the time of registration Not pregnant and not nursing, because this study involves an investigational agent whose genotoxic, mutagenic and teratogenic effects on the developing fetus and newborn are unknown. Therefore, for women of childbearing potential only, a negative urine or serum pregnancy test done =< 14 days prior to registration is required Age >= 18 years Eastern Cooperative Oncology Group (ECOG) performance status 0, 1 or 2 Estimated life expectancy of 3 months or longer Serum creatinine =< 2.0 mg/dL Aspartate aminotransferase (AST) or alanine aminotransferase (ALT) =< 3 x upper limit of normal (ULN) Fasting glucose > 1410 mg/dl Granulocytes > 1000/hpf No treatment with another antipsychotic agent, such as risperidone, quetiapine, clozapine, butyrophenone within 30 days of enrollment In order to complete the mandatory patient-completed measures, participants must be able to speak and/or read English or Spanish. Sites seeking to enroll Spanish-speaking patients should have access to Spanish speaking staff on site or through the use of a translation service to be able to conduct the informed consent discussion in Spanish, and to conduct the weekly phone calls  Exclusion Criteria:  Psychiatric illness which would prevent the patient from giving informed consent Medical condition such as uncontrolled infection (including human immunodeficiency virus [HIV]), uncontrolled diabetes mellitus or cardiac disease which, in the opinion of the treating physician, would make this protocol unreasonably hazardous for the patient Patients who cannot swallow oral formulations of the agents Patients with impaired decision-making capacity (such as with a diagnosis of dementia or memory loss) are not eligible for this study No presence of a hormone-sensitive tumor, such as breast, endometrial, or prostate cancer (this exclusion criterion is intended to circumvent any confounding antineoplastic effects of megestrol acetate)