Jump to content
BejoIjo

[WIP] Free GTA Memory (no more ghost car, improve GTA stability)

Recommended Posts

Hi,

 

I just wrote a simple RPH plugin to overcome my issue with the "ghost car".

What is it? "Ghost car" is car without driver that might appear after you play the game for a while (30-60 minutes).

 

This strange phenomena happens because GTA has a bug which somehow it doesn't clean up all entities properly.

When GTA runs out of allocated memory to display peds, it can't create new ped to be spawned as a vehicle drivers.

 

This GTA bug affects LSPDFR traffic stop functionality as well as some other issues (e.g. unable to stop walking peds with E key).

 

There's a cure for this which is included in RagePluginHook. You can always open the console and type "CleanWorld".

This cure is indeed working. But I don't like it because it is a brute solution.

Sometimes, I got flickering or missing textures a while after submitting "CleanWorld" command.

 

The plugin that I wrote will overcome the GTA bugs by periodically cleaning up entities which is already out of sight.

Don't worry. It is safe because it only cleans up non-persistent entities. 

Other than that, it will not clean up a blipped entities, which is usually spawned by callouts. So, your callouts will still work fine.

 

I've tested using it and after 2 hours, I didn't  encounter any "ghost car". (usually, after 1 hour I would see them)

 

I haven't released it on the mod download page, because I want to have your feedback first.

 

Please try this out:

 

Since this is an RPH plugin (not LSPDFR), simply put it in the "Plugins" folder and make sure to check it in RPG plugins settings to be loaded during startup.

Otherwise, you can also load it manually from RPH console by typing: LoadPlugin FreeGTAMemory.dll

 

Please try and give me your feedback. Enjoy!

 

BR.

 

 

Edited by BejoIjo

Share this post


Link to post
Share on other sites

That sounds almost too good to be true @BejoIjo! I seem to get texture losses in Palermo bay and when I’m driving around in the desert. And like you said, cleanworld fixes it but it doesn’t feel right. 

I’ll get back to you as soon as I’ve tried it. Thanks for your work!

Share this post


Link to post
Share on other sites
2 hours ago, 0taku said:

Is this a ragehook bug, because I've play hours at once and never had this 'ghost car' bug

 

You're fine then. I guess your rig is pretty new and high end one.

 

1 hour ago, Kalleboston said:

That sounds almost too good to be true @BejoIjo! I seem to get texture losses in Palermo bay and when I’m driving around in the desert. And like you said, cleanworld fixes it but it doesn’t feel right. 

I’ll get back to you as soon as I’ve tried it. Thanks for your work!

 

Yes. Please give it a try. You'll not regret it. You will also feel that your surrounding will be more dense and alive, because the game is now free to spawn any entities it wants.

e.g. more variety of peds and vehicles.

 

I'm using i5 + 16GB RAM and GTX 1060 and so far I have been very happy with current performance achievement.

I can play hours with stable 60FPS without texture losses.

 

FYI.

I installed 80 real cars replacements, also a few new police and sheriff cars slots ( total 7 police cars and 4 sheriff cars slots)

Installed 5 RPH plugins, 20 LSPDFR plugins, 2 scripthookvdotnet plugins.

 

Last but not least, don't forget to use a good gameconfig.xml tweak file.

Currently I'm using:

 

Share this post


Link to post
Share on other sites

I would be interested in trying this as well. I also periodically get missing textures etc and it's very annoying so if this helps, I would be so relieved because it's a pain in the *** lol. Anyway's yeah i run a 4790K OC to 4.6GHZ and 8gb of ram with a EVGA 1070 TI FTW2. 

Share this post


Link to post
Share on other sites

UPDATE: I have tried this script and it appears to be working...I haven't had disappearing textures as of yet and thats an hour into the game. Usually i'd experience it within 30 minutes. 

Share this post


Link to post
Share on other sites
4 hours ago, BejoIjo said:

If you are having lag when using this plugin, please try the updated version: (0.2.0.0)

 

 

I can’t wait to try this. I would use clean world true in console command but that took extra time to do. I can’t wait to try it. Bejolio I would love to help test if you need anyone to test. 

Share this post


Link to post
Share on other sites
7 hours ago, Wayne George said:

UPDATE: I have tried this script and it appears to be working...I haven't had disappearing textures as of yet and thats an hour into the game. Usually i'd experience it within 30 minutes. 

 

Glad to know. Please let me know if you have any side effects (e.g. game crashes)

 

6 hours ago, JBuzz826 said:

I can’t wait to try this. I would use clean world true in console command but that took extra time to do. I can’t wait to try it. Bejolio I would love to help test if you need anyone to test. 

 

Go ahead. Just grab it by clicking the link inside the spoiler.

Share this post


Link to post
Share on other sites
30 minutes ago, BejoIjo said:

 

Glad to know. Please let me know if you have any side effects (e.g. game crashes)

 

 

Go ahead. Just grab it by clicking the link inside the spoiler.

so after a couple of weeks trying to figure out why my cars would all of a sudden be empty and just be driving around with no one in them

and not be able to perform traffic stops on them  and so on i  figured i come here and ask if any one had any ideas. And i happened to come across

the topic. So i put your plugin in my game and it works !! I played for a little over an hour AND NO GHOST CARS!!!! After about thirty  mins of game play

i would have ghost cars sometimes a little longer...but on average thirty min. I went as far as taking plugins out one at a time which to took a while back and fourth

nothing.....So with this plugin it looks as if the ghost of los santos have been defeated..... Thanks for sharing this I can see this being useful for others and good plugin

for lspdfr website............................

                                                                                                                                                                                            Wantedelf

Share this post


Link to post
Share on other sites
47 minutes ago, wantedelf said:

so after a couple of weeks trying to figure out why my cars would all of a sudden be empty and just be driving around with no one in them

and not be able to perform traffic stops on them  and so on i  figured i come here and ask if any one had any ideas. And i happened to come across

the topic. So i put your plugin in my game and it works !! I played for a little over an hour AND NO GHOST CARS!!!! After about thirty  mins of game play

i would have ghost cars sometimes a little longer...but on average thirty min. I went as far as taking plugins out one at a time which to took a while back and fourth

nothing.....So with this plugin it looks as if the ghost of los santos have been defeated..... Thanks for sharing this I can see this being useful for others and good plugin

for lspdfr website............................

                                                                                                                                                                                            Wantedelf

 

Glad to know the ghost cars have gone! 

 

===========================================================================================================

 

Hi,

 

Please try the new updated v0.3.0.0 with improved stability.

 

 

I'll release this as soon as I got more feedbacks from you guys.. Thanks for your support.

 

BR.

 

Edited by BejoIjo

Share this post


Link to post
Share on other sites
On 12/31/2017 at 11:37 AM, BejoIjo said:

 

Glad to know the ghost cars have gone! 

 

===========================================================================================================

 

Hi,

 

Please try the new updated v0.3.0.0 with improved stability.

 

 

I'll release this as soon as I got more feedbacks from you guys.. Thanks for your support.

 

BR.

 

Yeah no problem at all. I will test it out tonight and i'll let you know how it works. 

Share this post


Link to post
Share on other sites
On 1/2/2018 at 12:27 AM, Wayne George said:

@BejoIjo I just tested the latest version and observed texture loss again for V3.

 

Hi, thanks for your report.

Texture loss might be caused by many things:

  • GTAV memory leak (inevitable)
  • not enough RAM
  • not enough VRAM
  • wrong windows virtual memory setting
  • need better gameconfig.xml
  • too many mods and plugins that you rig can handle.

Because of memory leak issue in GTAV, basically what we can do is delaying the problems to happen.

One thing that makes me happy is FreeGTAMemory plugin indeed can neutralize the "ghost car" issue which usually happen on my game.

 

I'll release it in a few days to the download page. Thanks to all you guys for your support.

 

Share this post


Link to post
Share on other sites
7 hours ago, BejoIjo said:

 

Hi, thanks for your report.

Texture loss might be caused by many things:

  • GTAV memory leak (inevitable)
  • not enough RAM
  • not enough VRAM
  • wrong windows virtual memory setting
  • need better gameconfig.xml
  • too many mods and plugins that you rig can handle.

Because of memory leak issue in GTAV, basically what we can do is delaying the problems to happen.

One thing that makes me happy is FreeGTAMemory plugin indeed can neutralize the "ghost car" issue which usually happen on my game.

 

I'll release it in a few days to the download page. Thanks to all you guys for your support.

 

Okay yeah i think it might be due to either RAM or a gameconfig.xml issue. But yeah this plugin it's definitely killed the ghost cars. Your welcome for the support, anytime ;) 

Share this post


Link to post
Share on other sites

Anyone tried this with a heavily car modded GTA?

 

Last time I tried to mod all of my cars to real cars (even taking into consideration not using insanely high polygoned or oversized .ytd cars), I got major texture bug, but I believe this mod might be able to solve that issue.

Share this post


Link to post
Share on other sites

This does not seem to fix the "Hold E to Stop" bug that plagues LSPDFR as you mentioned in the description. It still only works once per game load unless you arrest someone at gunpoint, then free them. For whatever reason that allows you to do the "Hold E to Stop" action again.

Share this post


Link to post
Share on other sites

I find it surprising that this is any more than placebo effect. Entities which are not marked persistent already get cleaned up (very aggressively!) by the game engine when they are not within view of the player. If you aren't cleaning up persistent entities, then the total entity count will still rise. Essentially all this is doing, is making the cleanup process more aggressive. I guess it works for some people, and since the game doesn't let you customize the aggressiveness of the cleanup it's a help for some people. 

 

Those who have these types of issues might also try out this heap adjuster which increases the total memory that GTA allocates for itself: https://www.gta5-mods.com/tools/heap-limit-adjuster-600-mb-of-heap


[WIP | Beta] Coastal Callouts: Upcoming action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response
[REL] Custom Backup: Bringing ultimate customization power to LSPDFR backup!

Join the Parks Benefactor Program to support my work and get early beta access!

Share this post


Link to post
Share on other sites
On 3/1/2018 at 10:20 PM, PNWParksFan said:

I find it surprising that this is any more than placebo effect. Entities which are not marked persistent already get cleaned up (very aggressively!) by the game engine when they are not within view of the player. If you aren't cleaning up persistent entities, then the total entity count will still rise. Essentially all this is doing, is making the cleanup process more aggressive. I guess it works for some people, and since the game doesn't let you customize the aggressiveness of the cleanup it's a help for some people. 

 

Those who have these types of issues might also try out this heap adjuster which increases the total memory that GTA allocates for itself: https://www.gta5-mods.com/tools/heap-limit-adjuster-600-mb-of-heap

 

Hi, I disagree with you saying this is just a placebo effect.

It does have an effect, especially fixed my "ghost car" issue. If you scroll up a few threads, there are users who also found this plugin useful and fixed their issue.

 

For users who  don't have "ghost car" issue, you don't need this plugin. As simple as that.

Share this post


Link to post
Share on other sites

I agree with @BejoIjo. For me this plugin did fix the "ghost car" issue and it has also improved stability as I haven't had a CTD for a while now. Btw, when do you plan on doing a public release of this plugin? And one more thing, just want to thank you for all your hard work lately. It's very much appreciated. :thumbsup:

Share this post


Link to post
Share on other sites

I have issues with my GTA where I get "Game ran out of memory" errors after about an hour to 3 hours of gameplay on LSPDFR. Usually happens when I hit pause but would also sometimes happen trying to perform tasks for a callout or traffic stop.

 

I have an i7 6700K, 16GB 2800Mhz DDR4 RAM and a 6GB 1060. My RAM usage typically peaks around a little under 8GBs before a crash occurs. Would this plugin actually help me? Friend of mine recommended this plugin to help.

Edited by SanguinemLuna

Trooper Luna, Unit# 3C15/3-Charles-15, Liberty State Trooper

Share this post


Link to post
Share on other sites
On 12/30/2017 at 6:51 PM, BejoIjo said:

Hi,

 

I just wrote a simple RPH plugin to overcome my issue with the "ghost car".

What is it? "Ghost car" is car without driver that might appear after you play the game for a while (30-60 minutes).

 

This strange phenomena happens because GTA has a bug which somehow it doesn't clean up all entities properly.

When GTA runs out of allocated memory to display peds, it can't create new ped to be spawned as a vehicle drivers.

 

This GTA bug affects LSPDFR traffic stop functionality as well as some other issues (e.g. unable to stop walking peds with E key).

 

There's a cure for this which is included in RagePluginHook. You can always open the console and type "CleanWorld".

This cure is indeed working. But I don't like it because it is a brute solution.

Sometimes, I got flickering or missing textures a while after submitting "CleanWorld" command.

 

The plugin that I wrote will overcome the GTA bugs by periodically cleaning up entities which is already out of sight.

Don't worry. It is safe because it only cleans up non-persistent entities. 

Other than that, it will not clean up a blipped entities, which is usually spawned by callouts. So, your callouts will still work fine.

 

I've tested using it and after 2 hours, I didn't  encounter any "ghost car". (usually, after 1 hour I would see them)

 

I haven't released it on the mod download page, because I want to have your feedback first.

 

Please try this out:

 

Since this is an RPH plugin (not LSPDFR), simply put it in the "Plugins" folder and make sure to check it in RPG plugins settings to be loaded during startup.

Otherwise, you can also load it manually from RPH console by typing: LoadPlugin FreeGTAMemory.dll

 

Please try and give me your feedback. Enjoy!

 

BR.

 

 

 

On 1/9/2018 at 8:42 PM, Sgt.Kanyo said:

Anyone tried this with a heavily car modded GTA?

 

Last time I tried to mod all of my cars to real cars (even taking into consideration not using insanely high polygoned or oversized .ytd cars), I got major texture bug, but I believe this mod might be able to solve that issue.

 

Hi man, I just signed up to this forum only to thank you for this amazing script 😍. It saved my ass! I was getting crazy trying to figure out how to keep all my mods without crashing every 15-20mins. 

I have a heavily modded game: almost any terrain vehicle has been replaced with huge files; I have graphics mods such as natural vision remastered, la roads, la vegetations, time scripts, weather scripts and so on... Also I have installed the enchanted native trainer, which does is part to make the game heavier. 

My vechicles are only ADDONS, and I have 5 (if not more) scripthookvdotnet plugins installed.

 

I was running always in the "err_mem_embeddedalloc_alloc" error, but I also expanded the memory heap of the game to 650MB... Better, but didn't fix the problem. Now, with the bigger memory heap, your script and the gameconfig you suggested in the previous comments, I managed to run the game for over 1h without any crashes (I had no time for playing more, but I'll notify you for any updates). Also, I tried to stress my game by firing rockets in places with a lot of vehicles, but the game was still stable. So, well, thank you a lot and keep it up! 💪

 

Here are my system specs:

- i7-4770k OC 4.4Ghz (4ghz cache)

- 24GB RAM DDR3 OC 2133MHz CL11 (stock were 1600)

- GTX 1070 OC (2050MHz clock, 9200MHz memory)

- native 4K monitor... so huge amount of VRAM used 🤔

 

Some pics... 😎 https://drive.google.com/drive/folders/13SSwkjRhYo1sHUYpaXqGLmNMTmI7vVxD?usp=sharing

 

Desktop Screenshot 2018.07.03 - 11.30.36.99.png

Edited by GhRacer
corrections

Share this post


Link to post
Share on other sites

@BejoIjo UPDATE: played for almost 2h without any issue. Great fix 🤩 The only little issue I found is that some objects are despawning too quickly, such as trailers if I move a little around without looking them (but trailers despawn frequently also in the vanilla game, so that's not totally your fault). So you could try to improve this, but you made a great job anyway. Thank you a lot!

 

I also overclocked a bit more my gpu memory (making it less stable), bringing it to 9600MHz. No problems anyway! The game is more stable than usually.

Edited by GhRacer

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...