My friends and I often discussed how the holodeck would work between classes. Coming from a purely mechanical engineering standpoint, this is what we theorized:
Limited Space - In cases such as the pilot for Voyager, when many people are in a large area out of site of one another, our theory was each person has an image field projected around them that simulates the area they are supposed to be in. In reality, everyone is quite close. They state in at least one episode that the holodeck uses an energy treadmill to give you the illusion of movement. As you move, the image field you are in moves but you stand still to conserve space.
Illusion of Reality - It's also stated the holodeck uses replicator technology to make objects. Considering they've mastered energy manipulation, this doesn't actually take as much effort as you think. Remember that E is equal to m times the speed of light squared. If you enter a room with X amount of mass in items, the energy is drained from the ship. Then, once those items are no longer needed (such as leaving a room), they're vaporized into the exact same amount of energy it took to create them, so nothing is lost and it, in theory, didn't cost anything to do (excluding Entropy, and assuming there is any in E = mc^2. That's a discussion for another time).
Illusion of People - Since replicating people is impossible (or at least immoral), to create a realistic humanoid that feels real (IE, warm skin with actual skin texture) would be deceptively simple. Think about this: All matter is energy contained using different methods. To wit, your body is also energy in one state of existence. To wit, an artificial body can be created by mimicking those energy patterns.
If that last part sounds too Deus Ex Machina, it's not. It's actually true, because it exists now:
http://psycserver.psyc.queensu.ca/lederman/102.pdf
Everyone that hears about this calls shenanigans. I did too, until I saw it on a Discovery Channel program in which people tested it and all of them said it defiantly worked. By stimulating electrical senses similar to touching something like skin, or wood, or rock, it gave the perfect illusion the person was, even though they were just touching glass.
This would obviously be more energy draining than making objects and then deleting them, but I remind you the energy capabilities of a Matter/Anti-Matter reaction are pretty limitless.