You obviously haven't identified what the actual problem is.
If your application is running out of memory there can be many reasons, such as a poor design or traffic patterns.
If your application is incorrectly configured for the system on which it it running then that of course has nothing to do with the application itself.
Not to mention of course that at least in this posting you haven't even specified whether the two systems are in fact equal. Which would seem unlikely given that you have two different VMs (excluding testing itself why else would they be different.)