GTA IV draws a lot on the graphic card memory first before using system memory and locks increasing or maxing the grahics if there isn't enough. There are tweaks available, but the best option however is a new graphic card with a lot of onboard memory, if you really want to max it out with smooth lag free performance @ max graphics.
Download the latest graphic card drivers, specially if using a nVidia graphic card (that has a performance tweak increasing builtin specially for this game).
Upgrade GTA 4 with all the latest patchs, this game is released early riddled with bugs, slow downs and glitchs. This will help fix some.
If low memory graphic memory - try setting the resolution in the ingame settings to 800x600 (ugly low resolution), however you then will find you can then max all the other settings nicer and it looks better without graphical glitching and not limiting up as much. The more higher resolution you add requires larger textures which if it can't fit in graphic memory, slows and/or rips or simply restricts you from increase it.
View distance is the next huge graphic performance on this game, increasing that goobles more memory. You might have to reduce it a bit to get things running smoothly.
Turn shadow Density down (even all the way to 0), it also makes a huge difference.
Turn off 'clip capture' under the Game menu when you're actually playing the game, huge difference.
Disable v-sync - if your not getting any ripping effect. Unlimits your fps.
Run the social club in offline mode or rip it off the game entirely. Reviews showed the cracked version of the game actually was benchmarked to run faster fps than the original DVD. Just don't do anything illegal now, your'll lose out on the patch updates, etc.
If you really want to each time you start the game to give system prority:
press ctrl+alt+delete and set highest prority for 'GTAIV.exe' and 'LaunchGTAIV.exe' then return to game and play.
(Not recommended to use UN-RESTRICTION, but if you want to try)
You can add the parameter on startup (right click the icon and at the end of the target line) add:
-nomemrestrict
and/or
-norestriction
This will remove it's force restriction (first for video memory, second for system resources), if you believe your computer can handle more.
or if you really don't have enough video memory and don't wish to upgrade, use this instead:
-availablevidmem 2.0
This is a multiplyer on the game thinking there's more video memory. So if you have 256MB graphic card, it would think it's a 512MB, etc. When the game has used up all video memory, it will try use your system memory or virtual memory instead which will be slower but removes the restriction.
Seriously though, the graphic card can make or break this game like a twig!
Even if it's a high performance but low memory one.