"Process could not allocate memory" when loading practice session

Discussion in 'Bug Reports' started by cosimo, May 18, 2014.

  1. cosimo

    cosimo Registered

    Joined:
    Apr 14, 2013
    Messages:
    827
    Likes Received:
    99
    Today I found out something I believe it's interesting.

    Since build 660 (and unstable before that, probably 649?) I started experiencing "out of memory" errors when loading practice sessions.
    I never noticed any pattern before today. It seemed random, happening most of the time with memory intensive tracks.

    However, today I noticed something different.
    If I start rF2 from the launcher (single player mode) and click on the "Race" button immediately, the occupied memory shown in Task manager goes from ~200Mb to ~2000Mb and everything works.

    However, if I click on the vehicle selection and track selection, and *before* clicking Race I read the memory occupation in task manager, rFactor2.exe is now well over 2000Mb, without loading the practice session, still in the initial menu.

    If I then try to load a track like Nordschleife (version 1.6 for example) I consistently get an out of memory error ("Process could not allocate memory").

    Could this be a memory management problem?
     
  2. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,829
    Likes Received:
    611
    What cars and how many opponents do you try to load? Seems to be the 32bits program memory limit (under 4GB max ca be allocated by the game)
     
  3. cosimo

    cosimo Registered

    Joined:
    Apr 14, 2013
    Messages:
    827
    Likes Received:
    99
    Car model and opponents number is not relevant from what I've seen.
    In this specific case, it was with a Honda Civic and zero AI.
     
  4. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,829
    Likes Received:
    611
    I read again your post, and You say you already allocated 2GB before pushing Race !!!. So yes it's a new problem.
     
  5. Jorgen

    Jorgen Registered

    Joined:
    Oct 5, 2010
    Messages:
    558
    Likes Received:
    3
  6. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    11,253
    Likes Received:
    5,872
    You're missing the point of the OP; viewing the car/track selection is allocating a chunk of memory that contributes to the error, when you would expect it to make no difference.
     
  7. Jorgen

    Jorgen Registered

    Joined:
    Oct 5, 2010
    Messages:
    558
    Likes Received:
    3
    Yes I was, lol. Anyway, what UI (standard, minimalist etc) are you using, and what list mode? (spinner or list view)
    After testing a bit with the default UI and list mode, I don't see any big jumps when switching between cars and tracks, but on the other hand I don't have that many cars and tracks installed. Switching to spinner mode caused a noticable jump though, so perhaps all the car and track preview images are loaded during startup when you use that mode?
     
  8. cosimo

    cosimo Registered

    Joined:
    Apr 14, 2013
    Messages:
    827
    Likes Received:
    99
    OK but 2 GB for that? I'm skeptical. Using standard UI and list view usually. Usually because the setting doesn't stick IIRC.
     
  9. Jorgen

    Jorgen Registered

    Joined:
    Oct 5, 2010
    Messages:
    558
    Likes Received:
    3
    No, that sounds unreasonable, the track icons are usually only around a megabyte or two. Same for car icons, at least judging by the ISI Formula Masters icons. How many cars and tracks do you have installed? Any custom plug-ins which could act up?
     
  10. cosimo

    cosimo Registered

    Joined:
    Apr 14, 2013
    Messages:
    827
    Likes Received:
    99
  11. Jorgen

    Jorgen Registered

    Joined:
    Oct 5, 2010
    Messages:
    558
    Likes Received:
    3
    Ok, can you try this: Start rF2, check memory, then bring up the car selection UI (but don't switch car), check memory, then bring up the track selection UI (but don't switch track), check memory. Does memory usage increase just opening any of the selection screens? If it does, which UI adds most to the memory usage? Then try the same but actually switch between cars. Check memory between each switch. Finally switch between tracks. Check memory between each switch. Between which component switches does memory usage increase the most?

    I'm seeing ~200MB from scratch, a 20MB increase for the car selection UI and an additional 1MB for the track selection UI using list mode. Picking a new car or a new track doesn't add any more memory, but then again, I have the light build and very few cars and tracks installed. Pushing the boundaries on installed content will push memory usage, but it should not be to the extent you are seeing, so something weird is definitely going on.
     
  12. cosimo

    cosimo Registered

    Joined:
    Apr 14, 2013
    Messages:
    827
    Likes Received:
    99
    Tried again.

    I see ~199Mb at start.
    If I click on track selection, memory climbs up to 400Mb. I have plenty of tracks, ISI and not.
    If I click on car selection, memory goes up to ~2000Mb. If I select a car and go back to the main screen, memory usage doesn't decrease.

    So it's definitely the car selection that causes the issue.
     
  13. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    11,253
    Likes Received:
    5,872
    ... the issue being that you would expect any extra memory used in order to load all the available cars so you can select one, would be fully released and re-useable for actually loading the car(s) and track you've selected. From what's being reported here that may not be the case.

    Just trying to be clear and avoid more "32-bit applications are limited to ..." posts ;)
     
  14. cosimo

    cosimo Registered

    Joined:
    Apr 14, 2013
    Messages:
    827
    Likes Received:
    99
    Yes.

    In other words, I wouldn't give a damn if the actual car/track I selected would be loaded and I could start driving.
    However, what happens for tracks like Nords is that I get this "Process could not allocate memory" etc...

    I'm on 64-bit Windows with 16 Gb of RAM, so at least that's not my issue. I understand rF2 might not use all of it as of now, but that's not changed between builds, but this "Process could not allocate memory" never happened before 549 (unstable) and now 660 (stable).
     
  15. Jorgen

    Jorgen Registered

    Joined:
    Oct 5, 2010
    Messages:
    558
    Likes Received:
    3
    Thanks for reporting back cosimo. This must be a memory leak, and a very big one too. It's almost as if every MAS file containing vehicle and track data needed for the selection UI's are kept in memory after reading. That would explain why the vehicle selection UI uses more memory than the track selection UI, the track MAS files where the UI related data resides are typically much smaller than the car counterparts. Hopefully someone from the development team can comment on this bug.

    EDIT: Just an observation, after watching the file system access with the sysinternals process monitor, it seems as if rF2 reads from *every* vehicle MAS file even when clicking on cars within the same series. For tracks, it just reads data from the track I click on, not all the other ones.
     
    Last edited by a moderator: May 22, 2014
  16. DJCruicky

    DJCruicky Registered

    Joined:
    Jan 25, 2012
    Messages:
    1,432
    Likes Received:
    770
    I do know I had all manner of problems with rfactor2 with my old WindowsXp 32 bit system with 1gig video card. It was pick track, exit game, pick car, exit game, then load track. If I did not exit game each step it would crash on me when loading track. I do have a lot of tracks but. I do try use the list view as much as possible.
    Some of the spinner loading screens are huge, I've seen some as big as 5meg uncompressed. Think track and car makers need start making smaller sized spinner pics, that would help the time the spinner view takes to load. Same with vMods.
     
  17. cosimo

    cosimo Registered

    Joined:
    Apr 14, 2013
    Messages:
    827
    Likes Received:
    99
    FWIW, I verified and can confirm that the problem happens only with the spinner, not with list view.
     

Share This Page