The infamous missing texture problem
#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.
#26
Posted 19 November 2013 - 03:55 AM
(Just to make it clear: I am not a pro, just a "wannabe" programmer, so despite of Carlo's big words, what I say is not an analysis, just a thought of a (as we say here) sane peasant brain. So forgive me if I say untrue things sometimes, I believe the pros, no need for a decapitation.)
#27
Posted 19 November 2013 - 05:05 AM
I have to modify about 80 trainset files... I will see. I don't think it can be - only - a sound problem. In my test with loose consists memory usage increased also from first to second return to the start station. And in both cases the sound source buffer was full. So it seems that some other thing increased.
James,
I'm sure you'll find something interesting in your checks about viewer parts of trains (and I suspect not only of static trains)!
#28
Posted 19 November 2013 - 06:17 AM
Csantucci, on 18 November 2013 - 12:49 PM, said:
Isn´t there also a Utility out there that will perform this Switch on any existing program? I´ll dig in the swamps of my HD´Ds' Folder structures as I seem to recall I downloaded something like this for MSTS some time ago...
Cheers, Markus
#29
Posted 19 November 2013 - 10:17 PM
#30
Posted 19 November 2013 - 10:53 PM