Take a look at the article at the following link.
It is an old article. The references to particular steps with Desktop Manager and so forth will be to old versions, but the ideas will be the same. Also, you will need to download and install the OS package on your computer.
I have done this, or at least parts of it. You can free up a few MB's just deleting the extra themes. There are also "shrink" OS applications -- see crackberry.com -- but I have not used any of them and can't say anythink about those options.
What is your free memory before and after a battery pull? As I recall you need at least 10 or 12 MB after a battery pull for satisfactory operation, but 15 or 20 is better.
I'm sorry you're getting memory errors on your device. I'd recommend following our Device is running slow / freezing / or displaying low memory errors: BlackBerry (all devices) document to resolve this issue.