This phase I trial is studying the side effects and best dose of vorinostat when given together with decitabine in treating patients with advanced solid tumors or relapsed or refractory non-Hodgkin's lymphoma, acute myeloid leukemia, acute lymphocytic leukemia, or chronic myelogenous leukemia.