What's new

About a big oversight regarding memory usage in the game.

iuli24

Member
Joined
Apr 13, 2021
Messages
38
Reaction score
34
Server
Askone
Main Pilotname
Jul14n
Rank
99
Clan
Fatal Ascension
The game just updated with the new Ultra graphic setting. It looks awesome.. much better than the old High setting but there is 1 major issue I discovered pretty quickly as you can see and I believe it can be fixed rather quickly.

First of all, I played with the new Ultra settings in Earth in Unrest (pretty much one of the the laggiest planet in Tau Ceti).
The game ran fine for about 5 minutes... which is a record low to be honest.. and after that amount of time the fps started to plummet.
[ I am the guy who discovered how to improve the game fps and visual quallity a lot in a previous forum thread ]
Then I discovered something strange, the game won't go past 512 mb of ram (not Vram that's another thing) and while digging trough the log file, that Pirate Galaxy literally makes available for everyone to see, I discovered this major issue:

2022-02-15 12:26:09,905 [an.d-1] INFO adding java argument: -Xms40m
2022-02-15 12:26:09,906 [an.d-1] INFO adding java argument: -Xmx512m <- this to be exact
2022-02-15 12:26:09,906 [an.d-1] INFO adding java argument: -XX:+UseG1GC

The game isn't allowed to use more than 512 mb of ram... even though 32 bit java can use a maximum of 1024 mb.
Also the game runs fine for ~4 minutes because that's how little amount of time it takes for it to reach the 512 limit.
Even on the High setting it stays at around 480 mb of ram usage... which is way too close for comfort.
[On Ultra it sits at 510 mb usage. Clearly hitting the ram limit hard.]

Games do and will lag very hard if they reach any kind of memory limit because the CPU will be busy with garbage collection and trying to free up some RAM while it instantly refills back up.... instead of running the game well.

Regarding the video memory allocation (-XX:+UseG1GC), that is fine, the game uses 400 or so mb of Vram which is quite far from the 1 gb limit the devs set.


In conclusion, considering that it should be a very easy fix to implement into the game (literally a change from
-Xmx512m to -Xmx1024m and probably to only 1 line of code) I would like to see the devs take some action on this and change that ram limit.

*Side Note*

Changing the resolution doesn't and will not decrease the amount of memory the game uses, that only affects the amount of video memory used.
Changing the graphic setting can increase the fps and lower the amount of memory used (CPU ram.. DDR memory to be very clear) because it literally decreases the LOD (level of detail), number of effects and number of mantis being processed at once and probably some other things too that the developers themselves know about.

Also for some reason tickets aren't a thing anymore? Anyone know why? Because I would've written this to the devs directly in hopes of them seeing this issue sooner.
 
Last edited:

Narokath

Splitscreen Studios
Joined
May 28, 2013
Messages
894
Reaction score
1,885
Also for some reason tickets aren't a thing anymore? Anyone know why? Because I would've written this to the devs directly in hopes of them seeing this issue sooner.
Just a quick reply to this; tickets can still be issued through our support website. You need to go through the "Get Help" troubleshooter first.
 

iuli24

Member
Joined
Apr 13, 2021
Messages
38
Reaction score
34
Server
Askone
Main Pilotname
Jul14n
Rank
99
Clan
Fatal Ascension
First, thanks for the quick reply.
Second, I already tried Get Help -> I need help with a technical issue -> The game lags or runs badly -> Movement is not fluid -> and then got nowhere, basically a dead end.

And third.. pretty sure I no longer need to resend this in a Ticket form ^^, because you already saw it ^^.
 

Fission

Community Manager
Joined
Feb 22, 2019
Messages
1,973
Reaction score
591
Main Pilotname
Fission
Rank
99
Hello Pilot,

in such situation you could also follow those steps to write a ticket:

I need help with another kind of problem -> Bug Report -> Login (submit a ticket)

Greetings,
Fission
 

iuli24

Member
Joined
Apr 13, 2021
Messages
38
Reaction score
34
Server
Askone
Main Pilotname
Jul14n
Rank
99
Clan
Fatal Ascension
Thanks a lot. That worked.
I guess I should've checked the other options too before I started a forum thread.
Well.. it still reached the devs in the end so I'm more than happy ^^.
 

Eredin

Well-known member
Joined
May 13, 2020
Messages
313
Reaction score
593
Server
Trantor
Main Pilotname
Eredin
Rank
99
If there's a solution for that could you share it on forum please? Thanks ;)
 

Highway

Splitscreen Studios
Joined
Feb 23, 2010
Messages
1,708
Reaction score
1,180
Hold your horses. Your asumptions are not entirely correct. The JVM is the java virtual machine to run the game logic on. Its limited to 512MB for a reason to lower the impact of the GC (less pauses/stutter).
This does not mean that the native gamecode (render engine, etc.) can not allocate more memory. The game will take as much it can up to ~4GB (32Bit)
 

iuli24

Member
Joined
Apr 13, 2021
Messages
38
Reaction score
34
Server
Askone
Main Pilotname
Jul14n
Rank
99
Clan
Fatal Ascension
Hm. Honestly i would love to be able to have more control over such settings and see for myself. Because there are so many pc / laptop configurations out there.. It might run worse or better for me or for someone else.

Also Ultra settings have a very huge LOD which is nice.. but for some reason mushrooms in siri look out of place and floating in the distance, while also having a thick fog to mask the old low LOD.

And lastly.. yes you might be right Highway.. but that doesn't fully explain why the game tanks in fps as soon as it gets close to 512 mb of ram and never goes above it.

And about the hitches.. there are pleeenty of those already. Don't know if it would be worse with more ram available.. in theory it shouldn't make things worse.

Also.. please consider letting us enable /disable fps limit and or vsync.. no one explained to me why its so deeply forced on on this game.
(People say.. "you dont need more than 60 in this game... who cares".. that's wrong. When you're lagging below 60 fps hard.. the last thing you need is vsync turned on.)

I might run out of edits soon but..
forcing the cpu to run at its max turbo frequency makes an even bigger diffrence now.
Still i don't understand how can there be 1 thread at 100% usage and the cpu not clocking itself to max.... very annoying.
 
Last edited:

iuli24

Member
Joined
Apr 13, 2021
Messages
38
Reaction score
34
Server
Askone
Main Pilotname
Jul14n
Rank
99
Clan
Fatal Ascension
To be more specific why there cant be a fix for everyone.. as you said here: " Its limited to 512MB for a reason to lower the impact of the GC (less pauses/stutter). " this to me seems like a memory issue when using the integrated graphics of a cpu instead of the dedicated one.

The issue being cause the integrated gpu always uses system memory as video memory therefore being limited to what the ram itself can provide in terms of speed latency and capacity.

While, when using a dedicated gpu which has dedicated video memory that is completly separate from system ram, the issue described there might not appear at all.
 

Highway

Splitscreen Studios
Joined
Feb 23, 2010
Messages
1,708
Reaction score
1,180
Be my guest if you want to profile the performance and change the java parameters yourself to see if you get any long term improvement on your system.

- VisualVM JVM Profiler
- Java command line options

Be sure to read what each param does and test in a repeatable scenario to compare collected results.

Here are a few points where you can start. The rest you will figure out.

Code:
Game Folder:
%APPDATA%\Splitscreen Studios\Game Launcher\gamedata\Pirate Galaxy\

CommandLine:
"..\..\java_vm\bin\javaw.exe" -jar "PirateGalaxy.jar" gameId=pirategalaxy
 

Fission

Community Manager
Joined
Feb 22, 2019
Messages
1,973
Reaction score
591
Main Pilotname
Fission
Rank
99
Still i don't understand how can there be 1 thread at 100% usage and the cpu not clocking itself to max.... very annoying.
Hello iuli24.

The engine currently runs in single-thread which means it isn't gonna take more than 1 thread from your CPU leaving the rest "un-used", changing it would obviously increase performance but it requires a lot of iterations and changes that im not even sure if they can be done in a reasonable time :D
 

iuli24

Member
Joined
Apr 13, 2021
Messages
38
Reaction score
34
Server
Askone
Main Pilotname
Jul14n
Rank
99
Clan
Fatal Ascension
Hello iuli24.

The engine currently runs in single-thread which means it isn't gonna take more than 1 thread from your CPU leaving the rest "un-used", changing it would obviously increase performance but it requires a lot of iterations and changes that im not even sure if they can be done in a reasonable time :D
Yes. True. Run any single core performance benchmark or real world app and see ur cpu ramp up into oblivion. And start pg.. watch it ramp up barely and then slowly fall asleep for no apparent reason.

That's what happens with this specific game all the time no matter where i fly in the game or what i do.

Easy example:

Earth in Unrest with ultra settings and 50 fps with my cpu staying at 3.2 ghz.
While when forcing it manually to run at full blast.. it stays at 3.9-4.1 ghz permanently and the fps jumps to 60.

Also noticed some inconsistency between task manager and hardwareinfo64 reported cpu usage.
Task manager reports 100% usage on 1 core and the other only 60-80%. Which makes me think the cpu takes into consideration the wrong value. Very strange, very annoying, not very hard to fix and clearly making my cpu run hotter but honestly i don't care as long as it does its job.

Tbh i have absolutely no idea how the devs could fix this trough code. BUT fps cap and vsync don't help. If they would finally let us disable those.. it would keep that core working a lot harder so much so that the core frequency stays where its supposed to be by default and the fps overall being a lot higher.
 

iuli24

Member
Joined
Apr 13, 2021
Messages
38
Reaction score
34
Server
Askone
Main Pilotname
Jul14n
Rank
99
Clan
Fatal Ascension
Be my guest if you want to profile the performance and change the java parameters yourself to see if you get any long term improvement on your system.

- VisualVM JVM Profiler
- Java command line options

Be sure to read what each param does and test in a repeatable scenario to compare collected results.

Here are a few points where you can start. The rest you will figure out.

Code:
Game Folder:
%APPDATA%\Splitscreen Studios\Game Launcher\gamedata\Pirate Galaxy\

CommandLine:
"..\..\java_vm\bin\javaw.exe" -jar "PirateGalaxy.jar" gameId=pirategalaxy
Thanks a lot for this. But i still did not get any information about why vsync and fps cap are so forced on. So why? Why do i have to bare so many issues when a simple unckecking of a tickbox would fix those things? What does unlimited fps break? Give players what? Extra flight speed, shooting speed or? Why does everyone ignore that very important info i just asked for?

I understand that maybe you want to keep a level playing field for everyone but look at other games. They dont cap the fps permanently to 60 cause X player has a GT610 as a gpu and Y player has an RTX 3070.

So i would love to see some actual reason for at least why you're avoiding to talk about it.

Sorry but its been bothering me ever since I was in gemini. Managed to fix most of the issues myself.. (playing on eiu and calon and the new tc4 update still on my uhd630 instead of my gtx1050 would've been beyond horrible) and very low fps bothers me very much.. as you can see ^^.

Framepasing consistency is important not gonna lie. But literally found out that frame pasing consistency is very closely related to cpu frequency consistency. If your cpu jumps up and down very fast when its not supposed to.. your fps goes.. 55 60 59 30 55 60 aka a lag spike. (Sure not every lag spike is related to this but most are because more than half of them went away for me when keeping the cpu at max)

Also microstuttering is caused mostly by the cpu frequency also. Its very noticeable even on planets where i have 60 fps without forcing my cpu at all. Hard to explain in words but at stock it runs at "60" but feels like a 45-50. And after the cpu gets a quick slap to the face and does what i want not what it wants (4.0 ghz constant) the fps is butter smooth and that 60 fps actually feels like 60 fps. Laptop intel cpus are VERY stubborn. Even with my more or less hacky way of fooling it to run at full blast, it still likes to drop frequency for less than a blink of an eye.
And yes i talked to someone who has an overclocked i9 9900K (@5.2 ghz) and his game basically runs how i dream it to run on my computer. Cause he has a locked core frequency and it never ever changes from 5.2. So pc desktops have an even bigger potential to increase the smoothness in fps in pg.
 

Fission

Community Manager
Joined
Feb 22, 2019
Messages
1,973
Reaction score
591
Main Pilotname
Fission
Rank
99
Thanks a lot for this. But i still did not get any information about why vsync and fps cap are so forced on. So why?
Depending on the game, normally 60 FPS are a base for having a stable performance. Some developers don't allow more than 60 FPS because it would just show up constant ups-drops of FPS which wouldn't be the best. Also keep in mind that most people keeps using 60Hz monitors, i am not sure if you are familiar with what this means, but to make it short, if you use a 60Hz monitor and you are playing at 200 FPS, you aren't gonna be getting those FPS at all because the monitor can only display 60 images per second.
 

Highway

Splitscreen Studios
Joined
Feb 23, 2010
Messages
1,708
Reaction score
1,180
Game development is complex and when we decided how we build our render loop in the engine, capping it to 60fps was the best way to smooth the framepacing. Many elements in the underlying rendering is aligned to work on 60fps (particle update intervall, animations etc.)

Its not easy to just flip a switch to unlock framerate as many aspects would need a rework. VSync on the other hand is easier to disable but will introduce image tearing. You can force disable Vsync in your video drivers to see if it makes a difference on your low spec machine so that you can have variable framerate instead of the sync steps of the monitor HZ (60->30->15)
 

iuli24

Member
Joined
Apr 13, 2021
Messages
38
Reaction score
34
Server
Askone
Main Pilotname
Jul14n
Rank
99
Clan
Fatal Ascension
Actually. Honestly did not expect you guys to respond at all but i'm glad you did.

And finally.. someone explained why its locked.. like finally. Thanks a lot for that.

Also i already tried disabling vsync in the nvidia control panel with no luck. (Checked to see if tearing showed up but nope.. so it did not work) Tearing on the other hand doesnt bother me as much as low fps. Because i have to choose between one or the other i will choose higher fps and plenty of tearing.

Last thing, image tearing happens mostly when riding the fps very close to the screen refresh rate. And thats why.. fps cap now that i understand why its in place it can stay.. but vsync must at least become a checkbox in the game settings and here's why:

1. Not everyone has a 60 hz display. Many have 120.. 144 or above even. So image tearing will happen for them if the game reaches (for 144 hz for example) 143 fps.. 142.. 145.. or double that.. which realistically will never happen.

2. On a 60 hz display image tearing happens at 59.. 58.. 61 62 fps.. or 119.. 121 fps (double the refresh rate).

3. We lag haaard sometimes in heavy action.. sort of a more or less inside joke in Eart in Unrest mission "Battle for Earth".. many call it Battle for Lag : )). So having the option to disable vsync while still being able to have the limit to 60.. would be more than usefull because it will get those extra fps out.. to get people from 25 fps teritorry to maybe 30+. (Dropping the graphical settings does also work temporarely and we as players definitely used that trick before)
Also.. tearing wont happen at 35 fps.. or 25 in some cases. I mean it does show up if you move the camera sideways very fast.. but by that point you are looking for it.


Oh yeah. And about the vsync steps.. i totally get where u got that from. Yeah some laptops have that battery boost (fps limit to 30) or.. vsync that works in steps which is annoying to say the least. Thats not the case for me at all.
If you havent seen this by know.. i'm very computer savvy (especially on the hardware side of things and software. I'm not a programmer so thats not where i am good at ^^.)
My fps ranges from 60 all the way to 30 full spectrum. Doesnt just go.. 60 59 and suddenly 30 30 30 and when the action dies down it jumps to 60. It literally goes to every single fps number from 60 to 10 even (forced my cpu to run at 0.8 ghz and that was fun). Also checked this very closely with riva tuner (a nice overlay program that can show real time frame pasing on a graph while running the game) and i havent seen the broken 60 30 15 vsync fps happen ever.
 
Last edited:

Vesperion

Well-known member
Joined
Feb 24, 2010
Messages
1,819
Reaction score
587
Server
Askone
Main Pilotname
Vesperion
Rank
99
We lag haaard sometimes in heavy action.. sort of a more or less inside joke in Eart in Unrest mission "Battle for Earth".. many call it Battle for Lag : )).
I think the question here should more be what causes this type of lag as for PG it is mostly noticable the more stuff is happening at the same time like skill usage, explosions, particles, etc.

A good example here is when either an GM is holding an invasion and "goes overboard" with certain units or the famous Halloween Event that is only a giant field of green if everything is chaotic and the game then has to handle a lot of RFields at the same time.

For me it feels more like the game struggles with "to much happening at once" rather then just laging as i know other Online games that have a firework of effects in heavy situations but still runs smoothly or without such a big impact as that the game has to catch up again (even on max settings).

So i assume as absolute noob in terms of technical stuff that something else could be in the coding that causes this lag when fighting a big battle with a couple of Pilots on one location.
 

Highway

Splitscreen Studios
Joined
Feb 23, 2010
Messages
1,708
Reaction score
1,180
The issue is that DX9 is very prone to tank rendering when the batch count (independantly rendered objects) gets to high as it introduces to many state changes between the CPU and GPU. In additiona particle effect calculation is done by the CPU as well causing more load where the CPU is not able to prepare the frames in time for the GPU to render. (Lowering FPS)

Heavy battles with a lot of units will even bring a beefy system down to its knees. There is no way around that in an MMO where you encounter large group of enemies at the same time.
 

iuli24

Member
Joined
Apr 13, 2021
Messages
38
Reaction score
34
Server
Askone
Main Pilotname
Jul14n
Rank
99
Clan
Fatal Ascension
Be my guest if you want to profile the performance and change the java parameters yourself to see if you get any long term improvement on your system.

- VisualVM JVM Profiler
- Java command line options

Be sure to read what each param does and test in a repeatable scenario to compare collected results.

Here are a few points where you can start. The rest you will figure out.

Code:
Game Folder:
%APPDATA%\Splitscreen Studios\Game Launcher\gamedata\Pirate Galaxy\

CommandLine:
"..\..\java_vm\bin\javaw.exe" -jar "PirateGalaxy.jar" gameId=pirategalaxy

Tried many configurations regarding that cmd command.. the game starts up but nothing changed.. which is a bummer :/.
Weirdly enough even if I set the -Xms / -Xmx arguments to something way beyond 32 bit java can handle.. or something like 10 mb.. nothing happens... I mean the game starts up fine and all.. but it shouldn't with that much more memory, which makes me think it ignores those commands or.. I wrote them improperly (though I did this many times with minecraft servers and it always worked...).

"..\..\java_vm\bin\javaw.exe" -jar "PirateGalaxy.jar" java -Xms512m -Xmx1024m
pause


I even placed a pause inside to make it stop in case it errors out which it doesn't. I tried with that gameId=pirategalaxy thing but no change.

The -Xms argument should be the minimum heap size used at startup by the game.. but nope.. still way below the 512m I set it to and minecraft servers or even the game itself (both written in java aswell mind you)... can eat as much ram as you give them.. even though they don't actually use that memory.. they allocate that and task manager sees it as allocated memory for X server.

So why does the game ignore those arguments? (I tried maaaaaaaany other arguments beyond those 2.. those are just the ones I expected to work first try)
 
Top