The matter energy storage system in AE is rather odd and it imposes some kind of exponential cost to storing large stacks of items on small memory units.
Actually, it's the reverse. AE cells are
more efficient at storing large quantities of stuff, not less. A cell with only one item type in it can store roughly twice as many stacks in total as a cell with all 63 item types used. See
ME-Storage-Math.
I find my main problem when making a brand new ME system (for general storage and inventory) is typically that I don't have enough
slots for all the hundreds of small stacks of minor items, not that I don't have enough space for the huge stacks of cobble/dirt/etc. So I'll spam a bunch of 1k or 4k cells to get enough slots. As the more populous item types look like they're going to start to become a burden, I'll take some of those cells
out, purge them into the system (using an ME IO Port), and turn them into the next higher cell.
Remember: it only takes 3x of a cell to make the next higher version, but you get 4x the storage. So in fact, it's not exponentially more expensive to store large quantities, it's
less expensive the higher capacity you go. A single 64k cell holds 64x as much as a 1k cell (naturally), but only takes 27 1k cells to make. You probably wouldn't shoot for 64k as your first cell, but if you upgrade to it slowly, you're gaining "free" storage every time you combine cells and upgrade to the next level.
I'm not saying it's a cheap way to store things, mind you. And storing more stuff will always cost more in general. But you do get a "bulk discount" in that the more of a particular item you store, the less you're paying
per stack to store it.
Edit: Ah, did a reread and I sorta see what you're saying now — with a mix of sizes, it's happy to put large stacks of items on small cells and exhaust them.
I believe the ME sorting logic is that, when sorting an item, it always prefers cells that already have the given item type on them,
or that are preformatted to accept that item type. So if you preformat something and put it in, it may not start putting items on that cell until all the other cells containing that item are full.
The solution to this is to make an IO Port. Stick your formatted cell in the IO Port and tell it to take items from the network. It'll rapidly slurp everything up and put it into your formatted cell.
Now, the above works great
so long as nobody/nothing puts that item into the network in the period between when you pull it out of the IO Port and put it back into the ME Drive. If the item is being actively produced (e.g. by a farm), it may manage to get some stuff onto a non-preformatted cell before you can put your preformatted one in and "claim" that item type.
Three ways to solve that:
One, turn off whatever is producing that item briefly. If possible, that's the easiest way.
Two, find what cell(s) have that item on them, put them into the IO Port, and empty them into the network; it'll sort that item into other matching cells. If you do this for every cell that contains the item, eventually it'll put them all into the preformatted one.
Or three, you can make a small preformatted cell (say, 1k) to hold the item temporarily. Put that in the network, then take your bigger cell and slurp the item out of the network with the IO Port. In the time it takes you to put it back into the network, any of that item that shows up should go into your tiny preformatted cell. Then, once you've put the big preformatted one back in, you can take out the small one and use the IO Port to dump it into the network; it should all go into the big preformatted cell.
You can also use IO Ports to "defrag" your network. If you have rare items that are getting spread across a bunch of cells (because the cell fills up and then you add another one), you're wasting a lot of space by having more item type "slots" used than is strictly necessary. Once you get the popular items out into their own preformatted cells, then you can put cells into IO Ports and slurp / dump things from / into the network as needed in order to condense items into as few slots as possible.