View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0005960 | Spring engine | General | public | 2018-04-15 09:10 | 2018-04-16 02:39 | ||||
Reporter | silentwings | ||||||||
Assigned To | Kloot | ||||||||
Priority | normal | Severity | feature | Reproducibility | N/A | ||||
Status | resolved | Resolution | fixed | ||||||
Product Version | 104.0 +git | ||||||||
Target Version | Fixed in Version | 104.0 +git | |||||||
Summary | 0005960: unsynced callout to to get mem usage of all lua states | ||||||||
Description | [08:08:10] <[Fx]Bluestone> i think there should be a way to measure synced mem usage though [08:08:10] <Nightwatch> <ashdnazg#5048> that's a good idea [08:08:10] <Nightwatch> <ashdnazg#5048> an unsynced lua callout [08:08:10] <Nightwatch> <ashdnazg#5048> to get memory usage of all lua states (to allow profiling mem allocation by synced gadgets) | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | |||||||||
Attached Files |
|
![]() |
|
Kloot (developer) 2018-04-15 11:05 |
already exists, Spring.GetLuaMemUsage |
silentwings (reporter) 2018-04-15 16:51 |
Thanks! That does everything I was looking for except one small detail - since the callout is for unsynced lusstates only, I can't see a way to read (into an unsynced luastate) the amount of mem/allocs by (specifically) synced luarules. |
silentwings (reporter) 2018-04-15 16:54 |
Addendum: I think that the obvious soln of returning a table would be a bad idea because the profilers now call Spring.GetLuaMemUsage() one hell of a lot. Perhaps an additional callout Spring.GetSyncedLuaMemUsage() returning the obvious two/four args, would be best. I would offer to write it but I don't have a build env set up atm. |
Kloot (developer) 2018-04-15 17:24 |
there is one roundabout way to get the synced footprint: 1) for each unsynced state, send out the (local, global) results of GetLuaMemUsage via SendLua*Message 2) in the receiving gadget's RecvLuaMsg, forward these via Spring.SendToUnsynced 3) in RecvFromSynced, subtract sum(unsynced states) from the global footprint with some hackery the summing part could also be done directly inside GetLuaMemUsage. |
silentwings (reporter) 2018-04-15 17:50 |
I had thought of the roundabout way, but decided against it (its a bit awkward for a profiler running during an online game, which might be turned on/off by multiple users in a random sequence). > with some hackery the summing part could also be done directly inside GetLuaMemUsage. Wouldn't it be easier for an unsynced callout to trigger C++ code that called the collectgarbage("count") function of synced luarules and sent the result back into unsynced land? Or am I overestimating how easily the luastates can get hold of each others pointers? |
Kloot (developer) 2018-04-15 18:27 Last edited: 2018-04-15 18:27 |
right now states can not see each other (which is where the hack comes in), but once they do have access summing over the unsynced or the synced set (LuaRules + LuaGaia) will just be a detail. |
Kloot (developer) 2018-04-16 02:09 Last edited: 2018-04-16 02:39 |
I think 5587a2d2 + 7f43675f should cover it. |
![]() |
|||
Date Modified | Username | Field | Change |
---|---|---|---|
2018-04-15 09:10 | silentwings | New Issue | |
2018-04-15 11:05 | Kloot | Assigned To | => Kloot |
2018-04-15 11:05 | Kloot | Status | new => resolved |
2018-04-15 11:05 | Kloot | Resolution | open => fixed |
2018-04-15 11:05 | Kloot | Note Added: 0019020 | |
2018-04-15 16:51 | silentwings | Status | resolved => feedback |
2018-04-15 16:51 | silentwings | Resolution | fixed => reopened |
2018-04-15 16:51 | silentwings | Note Added: 0019022 | |
2018-04-15 16:54 | silentwings | Note Added: 0019023 | |
2018-04-15 16:54 | silentwings | Status | feedback => assigned |
2018-04-15 17:24 | Kloot | Note Added: 0019024 | |
2018-04-15 17:50 | silentwings | Note Added: 0019025 | |
2018-04-15 18:27 | Kloot | Note Added: 0019026 | |
2018-04-15 18:27 | Kloot | Note Edited: 0019026 | View Revisions |
2018-04-16 02:09 | Kloot | Note Added: 0019030 | |
2018-04-16 02:09 | Kloot | Status | assigned => resolved |
2018-04-16 02:09 | Kloot | Resolution | reopened => fixed |
2018-04-16 02:09 | Kloot | Fixed in Version | => 104.0 +git |
2018-04-16 02:39 | Kloot | Note Edited: 0019030 | View Revisions |