Okay, first of all it's not "Memory", it's "Hard Disk Space". Memory is non-volotile (ie, it's cleared every time you restart your computer), and therefore it's impossible for something to "take up memory". Also, you don't HAVE 3 Gb of Memory/RAM, because the maximum that Windows ME supports is 512mb.
Okay, by the sounds of it you deleted DirectX 9, which was a pretty stupid thing to do. But that's not your fault. A little knowledge can be a dangerous thing, and an important rule to remember is that if you don't know what something is, you don't delete it.
As far as a new operating system goes, if your system was running Windows ME then it's probably not powerful enough to run anything newer, unless you bought it new from a store in the last 2 years or so, in which case it should be suited to run Windows 2000, which is much more stable and secure than any of the old Windows 9x series. (Yes, Windows ME was Windows 99, effectively, with a version number of 4.9.3000 - Windows 95 was 4.0.950).
The first thing to do would be to obtain a Windows 98 Second Edition CD, or a Windows 2000 CD. Windows 98 Second Edition would most likely be your best bet, since Windows 2000 may be too over-specced for your system. (Most systems that shipped after 2001 came with Windows XP Home edition pre-installed).
Windows 98 Second Edition is almost the same as Windows ME, but it's not crap. Or at least, it's not as crap as Windows ME. You could probably get 98 SE from a friend, or download it from IRC or KaZaA, somewhere like that.