  In this paper we examine boundedness of fractional maximal operator. The main
focus is on commutators and maximal commutators on generalized Orlicz spaces
for fractional maximal functions and Riesz potentials. We prove their
boundedness between generalized Orlicz spaces and give a characterization for
functions of bounded mean oscillation. To best of our knowledge, these results
are also new in the special case of double phase spaces.
