I was trying to download the official JRE 8 v271, but Oracle wants me to create an account and even so, the download wasn't for a .7z but an exe (which isn't helpful). I generally don't like to download executable code from random githubs (no offense meant at all). Because hackers gonna hack.
Hello guys I have been a vanilla player for over a year or so and for most of that time have been drooling over all those cool ship mods. today I tried to install a couple, I followed these directions and watched Ashergames video a couple times before i tried. The mods are extracted to the mod folder but the launcher says i have no mods installed. where did i go wrong. Love the game guys thank you
Levi
Alright, I'm going to paste a bunch of instructions on how to track down memory leaks. My apologies for the spam. :)
I use VisualVM (https://visualvm.github.io/), but another common tool is Eclipse's MemoryAnalyzer (https://www.eclipse.org/mat/). Here are the basic instructions for confirming a memory leak in VisualVM (finding one is a little harder if you don't know what's being leaked, but you can probably figure it out by looking through the various tabs).
First you'd want to create the heap dump. You can do this with external tools, but the console mod includes a "dumpheap" command that will create one from within the game. Do this after the memory leak occurs. This will save a .hprof file in your starsector-core folder, which can be massive (it will contain the state of every object in the Java Virtual Machine, and can be multiple gigabytes in size).
Once you have your heap dump, open VisualVM and load the newly created.hprof file. You'll see this screen:Spoiler(https://i.imgur.com/RgopB2A.png)[close]
Click "Summary" in the top left and switch to the "Objects" tab. Then enable the Fields and References views by clicking them along the top of the bar. The view should now look like this:Spoiler(https://i.imgur.com/X3jF6XK.png)[close]
Tracking down a memory leak is tricky, but "luckily" the nature of a memory leak in a garbage collected environment means that everything referenced by a leaked object will be retained, as will everything those objects reference, almost always ending with the entire combat engine or campaign sector being leaked. Therefore we can look directly for those two objects and save ourselves a ton of searching.
At the bottom of the screen is a Class Filter input. Since we're hunting a combat memory leak, enter CombatEngine and press enter. CombatEngine is Starsector's internal implementation of CombatEngineAPI. For sector leaks, you'd filter for CampaignEngine, which is the game's implementation of SectorAPI.
If there is a memory leak involving the combat engine, you should see multiple instances of com.fs.starfarer.combat.CombatEngine. Click on them and check the References subwindow to see what's keeping them in memory. In the example image you can see that two Shadowyards scripts (MS_ShikiPiercePlugin and MS_ArmorPiercePlugin) have static references that are keeping the previous combat engine instances in memory:Spoiler(https://i.imgur.com/fIX3YE4.png)[close]
Hey Wisp, do you know if there's been any consensus as to whether the Java 8 upgrade that you and Alex had people try earlier this year works any better than the one that people had been using for awhile?
It works about the same. The newer JRE 8 has some micro-optimization, bugfixes, and security improvements, but nothing that noticeably affects Starsector (security is important for e.g. servers, not critical for an offline game that only runs trusted code).
On the flip side, the newer JRE requires modifying the vmparams file by hand, unlike the one in this thread, so I will continue to recommend the older one here due to its ease of install.
This one: https://fractalsoftworks.com/forum/index.php?topic=28209.0
claims to increase performance by around 10%. I don't use it myself and consider it more of a "mad scientist" project than a well-tested alternative; it has undergone a series of revisions to fix crashes already for just a small userbase.
Hey Wisp, do you know if there's been any consensus as to whether the Java 8 upgrade that you and Alex had people try earlier this year works any better than the one that people had been using for awhile?
It works about the same. The newer JRE 8 has some micro-optimization, bugfixes, and security improvements, but nothing that noticeably affects Starsector (security is important for e.g. servers, not critical for an offline game that only runs trusted code).
On the flip side, the newer JRE requires modifying the vmparams file by hand, unlike the one in this thread, so I will continue to recommend the older one here due to its ease of install.
This one: https://fractalsoftworks.com/forum/index.php?topic=28209.0
claims to increase performance by around 10%. I don't use it myself and consider it more of a "mad scientist" project than a well-tested alternative; it has undergone a series of revisions to fix crashes already for just a small userbase.
Pray tell, are there also instructions for updating to the latest Java? (currently 21)They exist I'm sure, but it's not something I would link in a pinned post (also I don't know where to find it). There isn't much for performance gains to be had from newer versions (maybe recompiling the game for a newer version would, not sure).
And once done, does that allow writing mods in the appropriate language version (or are there restrictions due to that Janino compiler and/or does that also have to be updated)?You could, yes. Janino is only used for non-compiled code, so as long as your mod is compiled then you can use up to whatever version of Java the game is running on.
I see people write mods in Kotlin, but to my knowledge, Kotlin (like all JVM languages) can target a wide array of older Java versions by emitting runtime code to emulate missing language features, so that is probably not indicative.
Kotlin can indeed compile down to Java 6 (1.6) bytecode, but support for that has been dropped in the most recent releases of Kotlin, so we're limited to an increasingly old version of Kotlin (and hoping that IDE plugin support for that version is maintained).
Personally, I waffle back and forth on forcing my own mod, Persean Chronicles, to require Java 8. It would be an artificial requirement, as nothing in it actually needs 8, and may cause some drama/discussion since there aren't currently any mods on the Forum that require 8 as far as I know (though PC is a fairly niche mod). But Java 8 is something all modded players should be using, anyway, and sometimes it feels that any increased visibility of it would be worth it (not to mention the benefits to programmers in Java QoL features).
# Get the current directory
$currentDir = Get-Location
# Iterate through all .zip files in the current directory
Get-ChildItem -Path $currentDir -Filter *.zip | ForEach-Object {
$zipFile = $_.FullName # Full path of the zip file
$destinationPath = $currentDir.Path # Destination is the current directory
# Extract the zip file contents
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipFile, $destinationPath)
Write-Host "Extracted: $($_.Name)"
}