bac9 Posted January 1, 2015 Author Share Posted January 1, 2015 Thanks, those are interesting results.And about craft loading, - yeah, it's supposed to reset RAM usage completely unless KSP does something wrong. Memory leak most likely occurs simply because some objects are created, forgotten about and created again, piling up in memory (for example, some geometry). As the craft loading is implemented as reloading of the SPH scene, those objects can't survive it - Unity garbage collection (search for all objects that are not referenced from anywhere) clears all objects like that on any scene change. Quote Link to comment Share on other sites More sharing options...
Agathorn Posted January 1, 2015 Share Posted January 1, 2015 This is just outstanding man. Literally the first procedural parts I actually want to use because they don't look like crap.The main note I would like to make right now, after just a few minutes with them, is that they don't scale down to small sizes very well. I was trying to use them as control fins on a .3m rocket and it just wouldn't work.The texture is not meant to be used on a small scale like that, and leading/trailing edges do not have scaling proportional to semispan and width, so at the moment those parts are unfit for small craft like that, yeah.Well it almost works. Yeah the texture looks odd simply because of the relatively large size of the "blocks" but the UVs still hold up fine. And the overall scaling works, almost. Really if you could just allow all the settings to go a nothc smaller it would work. The biggest problem was the control surface. While I could make it roughly fit in with the winglet, the control surface was longer than I wanted, IE extending farther behind the trailing edge, towards the rear of the craft, than it should.I guess my point is it ALMOST works, so maybe if you could just let it go a tad smaller...?I also have to second the ability to control sizing from CONFIG{}. It is a very important thing for many of the big career mode mods and I would bet you can find some code to use directly for it. Quote Link to comment Share on other sites More sharing options...
bac9 Posted January 1, 2015 Author Share Posted January 1, 2015 Additionally, I'd like to know whether memory leak persists into the flight scene. If there are no noticeable leaks with aforementioned craft with just one wing part, try flying a full-fledged craft like the sample fighter jet too.Well it almost works. Yeah the texture looks odd simply because of the relatively large size of the "blocks" but the UVs still hold up fine. And the overall scaling works, almost. Really if you could just allow all the settings to go a nothc smaller it would work. The biggest problem was the control surface. While I could make it roughly fit in with the winglet, the control surface was longer than I wanted, IE extending farther behind the trailing edge, towards the rear of the craft, than it should.I guess my point is it ALMOST works, so maybe if you could just let it go a tad smaller...?I also have to second the ability to control sizing from CONFIG{}. It is a very important thing for many of the big career mode mods and I would bet you can find some code to use directly for it.Yeah, I'm planning on making smaller sizes possible, but that will require some changes to cross section texture mapping for wings and some significant changes to allow variable trailing edges on control surfaces. As for gradual size unlocks, I'm investigating that too.Could you add something similar to the standard canard or winglet? A standalone re-shape-able control surface that pivots at the center rather than have to make a small wing and trailing edge.Planned, but not in the next version. Quote Link to comment Share on other sites More sharing options...
bac9 Posted January 1, 2015 Author Share Posted January 1, 2015 Version 0.8https://bitbucket.org/bac9/b9_aerospace_plugins/downloadsChanged control surface geometry to allow topside and underside borders to go all the way to the trailing edge, improving the looks and readability of control surfaces with gray surface types.Added an additional wing edge type (round one)Improved texturing on wing edge cross sectionsControl surfaces can now have bigger widthsOther changes are internal and attempt to close the memory leak. I don't know whether they actually succeed at this, so I need detailed tests again. Quote Link to comment Share on other sites More sharing options...
bac9 Posted January 1, 2015 Author Share Posted January 1, 2015 Version 0.9https://bitbucket.org/bac9/b9_aerospace_plugins/downloadsThe mod is now compatible with NEAR (although I'd still recommend using FAR, near only receives compatibility patches these days and is not actively developed by ferram4 in contrast with FAR).Testing for memory leaks is still required. Quote Link to comment Share on other sites More sharing options...
Agathorn Posted January 1, 2015 Share Posted January 1, 2015 Excellent. Will take a spin on the new version here in a bit. Quote Link to comment Share on other sites More sharing options...
ZobrAA Posted January 1, 2015 Share Posted January 1, 2015 (edited) Gorgeous mode! Thx for this great present for the new year! And I have an idea: why not to add texture switching to the wings butt ends if we have it almost on all surfaces anyway? This will helps to make a pleasant fins... Edited January 2, 2015 by ZobrAA Quote Link to comment Share on other sites More sharing options...
kizza42 Posted January 2, 2015 Share Posted January 2, 2015 Just anecdotally, It seems I run out of memory quicker if I'm using the slider bars as opposed to the buttons for resizing, Maybe its the in between rescaling/reloading? Quote Link to comment Share on other sites More sharing options...
bac9 Posted January 2, 2015 Author Share Posted January 2, 2015 (edited) I'm inclined to believe that tweakable UI leaks memory when opened even on parts without my plugin, which is pretty weird. Edited January 2, 2015 by bac9 Quote Link to comment Share on other sites More sharing options...
DaMichel Posted January 2, 2015 Share Posted January 2, 2015 Awesome! (Didn't notice a mem leak nor did i pay attention to it)Cheers Quote Link to comment Share on other sites More sharing options...
bac9 Posted January 2, 2015 Author Share Posted January 2, 2015 (edited) Okay, still hunting down the leak.Aside from 0.9 testing, I'd like to know the results of testing this version of the library:https://www.sendspace.com/file/rmsmgvThere is almost nothing to test it with, actually, because I have removed all code from it but tweakables and an update method checking changes to those tweakables. No working functionality there. So, if you'll find that the memory leak still occurs with this version, only two possibilities will remain - either my update method leaks something, or Squad tweakables invariably leak something into memory.Aside from that, I'd like you to test tweakables on stock parts without adding any of my wings into the scene. Let's see if the leak originates in the tweakables themselves. Edited January 2, 2015 by bac9 Quote Link to comment Share on other sites More sharing options...
Sufficient Anonymity Posted January 2, 2015 Share Posted January 2, 2015 Dammit bac9, I'd just finished my set of career SSTOs (also B9-based, of course). These look gorgeous - will have to try them out. Quote Link to comment Share on other sites More sharing options...
lazza49 Posted January 2, 2015 Share Posted January 2, 2015 My base install has ATM, MM, and Ven's Stock Revamp installed. I am using 0.9, tested with your .dll above and the .dll from 0.9. I tested the parts by placing a Mk1 cockpit and attaching a part without symmetry.With just my base install:- Placing Mk1 cockpit and opening tweakables menu results in increase of ~1MB/s with drops of a few MB every few seconds keeping it seemingly stable(?).- Placing advanced canard on cockpit results in stable memory usage, opening the tweakables menu also results in stable memory usage.Base install + Procedural parts (.dll from 0.9 and .dll above):- Placing Mk1 cockpit and opening tweakables menu results in increase of ~2MB/s for ~5 seconds then stabilises.- Placing procedural wing on Mk1 cockpit results in seemingly stable memory usage, opening right click menu on wing results in sudden increase of 10-20MB, stabilises afterwards.- Placing advanced canard on cockpit results in stable memory usage, opening the tweakables menu also results in stable memory usage.Base install + Procedural parts (.dll from 0.9 and .dll above) + FAR:- Placing Mk1 cockpit and opening tweakables menu results in increase of ~2MB/s for ~5 seconds then stabilises.- Placing procedural wing on Mk1 cockpit results in stable memory usage, opening right click menu on wing results in constant increase of ~3MB/s after sudden increase of 10-20MB. When the right click menu is closed it stabilises.- Placing advanced canard on Mk1 cockpit results in stable memory usage, opening right click menu on wing results in constant increase of ~3MB/s after a few seconds delay. When the right click menu is closed it stabilises.Base install + FAR:- Placing Mk1 cockpit and opening tweakables menu results in increase of ~2MB/s for ~5 seconds then stabilises.- Placing advanced canard on Mk1 cockpit gives stable memory usage, opening right click menu on wing results in constant increase of ~3MB/s. When the right click menu is closed it stabilises. Quote Link to comment Share on other sites More sharing options...
sober667 Posted January 2, 2015 Share Posted January 2, 2015 Its posible that wings can have more various shapes like rounded corners or leading edge as a bow(like in shuttles) instead of being always strait?(waching it from abowe ) Quote Link to comment Share on other sites More sharing options...
Tarheel1999 Posted January 2, 2015 Share Posted January 2, 2015 (edited) The problem appears to come from the interaction between B9 Procedural Parts and FAR. I tested using a clean install with: (1) B9 Proc Parts by itself, and (2) B9 Proc Parts and FAR.Both were tested using one MK2 fuel tank and one procedural wing. With just B9 there was a small memory hit when the GUI was opened and left open but it quickly stabilized. With B9 and FAR when the GUI was opened and left open, memory usage increased until the game crashed. If I launched the craft under either scenario the memory reset. I did not conduct any testing on the runway. However in my regular install I've never experienced a crash while flying a craft with B9 procedural wings. I've only experienced a crash when spending a long time building a plane in the editor before launching.Out of curiosity, I also tested a clean install with just FAR. By continuously mashing buttons in the FAR GUI (Sweep AOA, Sweep Mach, Run Simulation, etc.), I was able to get memory usage to slowly increase with a MK2 fuel tank as the only part. I lacked the patience to see if I could ultimately cause a game crash because the increases were small and tedious to create.My guess is that when the GUI is open with FAR installed the wing shape is in flux or not sufficiently transparent to FAR which results in a nonstop memory leak as FAR attempts to simulate the aerodynamics. Edited January 2, 2015 by Tarheel1999 Quote Link to comment Share on other sites More sharing options...
K3-Chris Posted January 2, 2015 Share Posted January 2, 2015 bac9: #kspmodders mentioned that stock tweakables leak as well:http://i.imgur.com/e8qPKXA.gifhttps://i.4cdn.org/vg/1420196534801.webmAlso terrain is leaking: http://forum.kerbalspaceprogram.com/threads/105514-BUG-Memory-Leak-Flying-Near-GroundPretty safe to assume at this point it's a problem with the game, not your mod. Quote Link to comment Share on other sites More sharing options...
bac9 Posted January 2, 2015 Author Share Posted January 2, 2015 (edited) I'm afraid the issue is not linked to FAR or this particular mod and simply scales with amount of stuff in the tweakable UI, which happens to be longer than in stock and therefore leaks more memory. I'm reproducing the issue with a stock fuel tank here, although at a slower rate (probably because the window contains only two sliders):K3|Chris, I know, I posted those images in the first place. Edited January 2, 2015 by bac9 Quote Link to comment Share on other sites More sharing options...
K3-Chris Posted January 2, 2015 Share Posted January 2, 2015 Ah, whops. XD0.90.1 soon kthx squad. Quote Link to comment Share on other sites More sharing options...
Tarheel1999 Posted January 3, 2015 Share Posted January 3, 2015 While probably related I'm not sure the small leak in stock tweakables caused by GUI manipulation fully explains the continuous and more substantial memory usage that occurs with B9 Proc Parts and FAR with no GUI manipulation. I was able to crash the game in a relatively short amount of time by simply opening the GUI and leaving it open, i.e., no further manipulation, with only two parts (MK2 fuel tank and procedural wing) in the editor. I was unable to accomplish the same thing without FAR installed. Something else must be going on. Although I take your point that the problem may ultimately lie with code in the stock tweakables implementation and neither you nor Ferram can fix it. Quote Link to comment Share on other sites More sharing options...
The Space Man Posted January 3, 2015 Share Posted January 3, 2015 bac9: #kspmodders mentioned that stock tweakables leak as well:http://i.imgur.com/e8qPKXA.gifhttps://i.4cdn.org/vg/1420196534801.webmAlso terrain is leaking: http://forum.kerbalspaceprogram.com/threads/105514-BUG-Memory-Leak-Flying-Near-GroundPretty safe to assume at this point it's a problem with the game, not your mod.Do those memory leaks also happen on 0.25, or is it 0.90 only? Quote Link to comment Share on other sites More sharing options...
ferram4 Posted January 3, 2015 Share Posted January 3, 2015 Based on behavior, this probably goes back to the introduction of tweakables. This is probably not a new issue. Quote Link to comment Share on other sites More sharing options...
NathanKell Posted January 3, 2015 Share Posted January 3, 2015 Love this so much!Also--can't wait to see the tweaks you make for small wings--as Agathorn implies, small sounding rockets are now how one starts an RO career, so itty bitty wingy is important. :] Quote Link to comment Share on other sites More sharing options...
Agathorn Posted January 3, 2015 Share Posted January 3, 2015 This is the B9 Proc Wings on a 0.3m sounding rocket I made tonight. Really it still looks miles better than pWings IMHO. The only thing I would really like to see is more fine control. Why are the slider steps so large? Again this comes in more at smaller sizes than larger. When i'm trying to reproduce a real rocket, being forced to .250 meter increments makes it tough.WAC Corporal Quote Link to comment Share on other sites More sharing options...
Wampa842 Posted January 3, 2015 Share Posted January 3, 2015 (edited) Did the test, I can now confirm the obvious.[table=width: 500, align: left][tr] [td]Action[/td] [td]Memory usage[/td][/tr][tr] [td]Empty SPH[/td] [td]2 591 500 KB[/td][/tr][tr] [td]Mk2 Inline Cockpit alone[/td] [td]2 591 376 KB[/td][/tr][tr] [td]Procedural wing dragged onto the editor[/td] [td]2 591 752 KB[/td][/tr][tr] [td]P Wing attached[/td] [td]rose steadily (~ 2 MB/s) until I detached it at 2 605 024 KB. Did not leak when I reattached it.[/td][/tr][tr] [td]Opened P Wing tweakables menu[/td] [td]2 614 900 KB, started rising a few seconds later.[/td][/tr][tr] [td]Detached at 2 700 092, tweakables menu closed[/td] [td]rising, but significantly slower (~200 kB/s)[/td][/tr][tr] [td]Reattached and reshaped[/td] [td]rising at ~2.5 MB/s[/td][/tr][/table]I didn't have to wait long until KSP ran out of memory on its own at 3 773 672 KB.*edit*A little bug report, control surfaces tend to stall with full deflection at subsonic speeds. It doesn't seem to occur above mach 1.http://i.imgur.com/OvlngsD.jpghttp://i.imgur.com/pYQ69E7.jpghttp://i.imgur.com/FgU5tXT.jpgIt's just a minor bug, the stall never goes above 1%, but I thought it's best to report it. Edited January 3, 2015 by Wampa842 Quote Link to comment Share on other sites More sharing options...
bac9 Posted January 3, 2015 Author Share Posted January 3, 2015 Got all-moving control surfaces working, will arrive in the next version. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.