The infamous missing texture problem
#11
Posted 18 November 2013 - 07:43 AM
Another thing that I've noticed is that certain sound files and the like may "disappear" if one switches camera angles a lot, say, from the front of the train to the back, etc. I suspect the issue may be the same--loading files every time that take space in memory that never gets freed up until one quits the game and restarts it.
#12
Posted 18 November 2013 - 08:34 AM
Wouldn´t it be helpfuly to either shrink the graph´s Y scale or add a line to / at the Magic 1.6 GB, as to make it easier to determine when a save and restart should be performed?
Cheers, Markus
#13
Posted 18 November 2013 - 10:00 AM
Proof is here:

and here:

Number of downloads: 276
Only problem reported by the logfile is that the sound stream buffers are saturated, but this is only because probably they aren't fully released (maybe something to be investigated by Peter) (and anyhow their upper limit can be increased too). Sounds anyhow still could be heard well.
#14
Posted 18 November 2013 - 12:10 PM
markus_GE, on 18 November 2013 - 08:34 AM, said:
The technical limit is 2GB, but in practice you'll struggle to get more than 1.6-1.7GB because of fragmentation and other things interfering in ways you can't predict.
#15
Posted 18 November 2013 - 12:20 PM
#16
Posted 18 November 2013 - 12:49 PM
I found out some interesting results:
- memory usage at start: 1370 MB
- memory usage returning at start point: 1830 MB
- memory usage returning second time at start point: > 2 GB (reached 2048 MB and then started showing negative values :dance3: , with bar disappearing, see picture below:

Also at the end of the second run I got no disappearing textures and no errors in the error log, only again some warnings of sound source buffers full.
As I run twice forth and twice back, at least the second time there shouldn't be increase of memory usage. Instead there is a considerable one. So in my opinion there are important amounts of memory that aren't released where they should.
A second thing I found is that not all sounds are correctly released. In fact when returning to the intermediate station for the second time, some sounds of the local loose consists were loaded a second time. I attach here a screenshot from the soundtest interface:

The group of Le724wag.sms entries can be found on top and on bottom of the list, however they are duplicated entries of the same consist.
Referring to the request of ATW, it is not completely straightforward to generate and run such a release of OR, because it requires an extended development environment (Visual C# Express is not enough, or at least mine was not enough), and the change to the OS settings depends from the OS. I would prefer that the ORTS developers decide that within the SVN package there is a 2 GB as well as a Largeaddressaware version of OR, so that this is is easily available to everyone and people can select the version they prefer.
#18
Posted 18 November 2013 - 01:41 PM
Csantucci, on 18 November 2013 - 12:49 PM, said:
When I get my automatic builds back on-line (from a hard disk failure at the weekend), I should be able to include this easily there and in the weekly experimental builds. Of course, if you're on a 32bit OS, you'll need to reconfigure that if you want to see any difference, but at least on 64bit OSes people can just drop it in to try.
#20
Posted 18 November 2013 - 02:30 PM
Csantucci, on 18 November 2013 - 12:49 PM, said:
I am wondering if it is really a sound engine problem. Theoretically it is possible, the consists were really added the second time to the scene. (I haven't made any code investigations.)
#21
Posted 18 November 2013 - 10:35 PM
#22
Posted 18 November 2013 - 11:34 PM
In the case above and in similar cases I had the qualitative impression that memory usage growing from run to run was at least partially due to re-loading of consists.
So solving this problem would probably not only reduce occupancy of sound source buffers, but also reduce the general problem of unjustified increases of OR memory usage.
#23
Posted 19 November 2013 - 01:05 AM
#24
Posted 19 November 2013 - 02:14 AM
The tests of my preceding posts however show that there is memory leak with the loose consists. So I'm not able to enter into Peter and James' discussion, but there is something about memory release of loose consists that does not work; this is evidenced both by the double memory increase I had in such previous tests and by the double entries in the active sound source list.
By the way loose consists are trains too, I guess of type static. Do they have to be explicitly disposed or James' rule applies?
#25
Posted 19 November 2013 - 03:08 AM
Csantucci, on 19 November 2013 - 02:14 AM, said:
An object is collected (disposed) automatically once nothing else refers to it. So although we don't need to explicitly dispose them, we do need to make sure they are removed from whatever is holding on to them.
There are two main parts to a train: the simulation part, and the viewer part. The simulation part is not disposed unless it is an AI train and the AI is completed (and is removed), or that should be the case. If we disposed the simulation part, you'd no longer know where the train was! But this part should not use much memory at all. The viewer part is created on-demand, when a train is close enough to need to be visible, and should be disposed of once the train is far enough away to no longer be visible. There is also a cab part, which should work similarly to the viewer part.
It is quite possible we're not disconnecting the viewer or cab parts as we should; although I've carefully checked other parts of the viewer (mostly around terrain/scenery) to ensure we release things in due time, I have not done this with the train viewer parts. It's on my list though.