Closed Mintaras1 closed 1 year ago
Intredasting. Some questions:
-How much RAM do you have? (I ask because I've only tested the plugin on a PC with lots of RAM). Other pc specs might help
-When you try to write the image, is there a large spike in ram usage?
-Does the file .runelite/worldheatmap/osrs_world_map.png
exist?
I'm going to test it out on a laptop with less resources and see if I get the error, and review the code for memory leaks. Thanks for the bug report.
Saw the post in the runelite discord. I'm able to reproduce the same error 100% of the time and the cause is https://github.com/GrandTheftWalrus/RuneLite-World-Heatmap/blob/master/src/main/java/com/worldheatmap/WorldHeatmapPlugin.java#L432
Running runelite via the jagex launcher gives me a MaxMemory of 512mb with around 400mb being used. Running in intellij gives me a max of 16gb with 300-600 used. I assume my plugin setup could be the cause of the 400mb?
Running a "Type A" "Write Heatmap Image" lowers free memory by about 40mb just from loading osrs_world_map.png
Also this project is kind of a mess to look at, with the main issue being the random int arrays for x,y positions and the usage of runnables instead of lambda method references
Edit: With a bit of extra testing to see if I can get a more exact memory usage number, the code from here returns 123641856
bytes for your osrs_world_map.png
loaded into memory which would be a problem with the amount you have available.
-How much RAM do you have? (I ask because I've only tested the plugin on a PC with lots of RAM). Other pc specs might help
PC Specs: CPU: Ryzen 5 1400 RAM: 16gb (2x 8gb) GPU: AMD RX 570 OS: Win10 Pro 21H2 (Build 19044,1826)
-When you try to write the image, is there a large spike in ram usage?
Ram usage stays the same, only CPU usage gets a little usage spike, but thats all.
-Does the file .runelite/worldheatmap/osrs_world_map.png exist?
Nope. File structure for me looks loke this:
.runelite/
WorldHeatMap
Heatmap Files
Mintaras_TypeA.heatmap
Mintaras_TypeB.heatmap
Running runelite via the jagex launcher gives me a MaxMemory of 512mb with around 400mb being used
I'm also using Jagex launcher to launch RuneLite, but on my other RuneLite instance (separate account), launchet not thru Jaxes launcher, it still does not save heatmap image.
Saw the post in the runelite discord. I'm able to reproduce the same error 100% of the time and the cause is https://github.com/GrandTheftWalrus/RuneLite-World-Heatmap/blob/master/src/main/java/com/worldheatmap/WorldHeatmapPlugin.java#L432
Running runelite via the jagex launcher gives me a MaxMemory of 512mb with around 400mb being used. Running in intellij gives me a max of 16gb with 300-600 used. I assume my plugin setup could be the cause of the 400mb?
Running a "Type A" "Write Heatmap Image" lowers free memory by about 40mb just from loading
osrs_world_map.png
Also this project is kind of a mess to look at, with the main issue being the random int arrays for x,y positions and the usage of runnables instead of lambda method references
Edit: With a bit of extra testing to see if I can get a more exact memory usage number, the code from here returns
123641856
bytes for yourosrs_world_map.png
loaded into memory which would be a problem with the amount you have available.
Thank you for the advice. I was unsure about whether or not my use of Runnables was correct. Also, could you perhaps clarify what you meant about the random int arrays for x,y positions?
Currently, each Heatmap object stores the 2D matrix of steps per tile in a very large 2D int array, but now that it's become apparent that memory usage is more constrained than I originally thought, I'm going to make it so that heatmap data is stored in a more efficient way (probably by use of a hashmap where the keys are coordinates and the values are the step values). I'm also going to see if there's a way to load, edit, and write the heatmap image to disk in a way that uses less memory (not sure how to do that yet, since I'm already using BufferedImages, but maybe the foremost overuse of memory is due to the aforementioned method of storing heatmaps; the two heatmaps in memory being big ass 2D arrays of 32 bit integers are probably around 32 megabytes in total)
Thanks again for your input
Neither manual nor automatic image saving don't save heatmap as an image. When trying to do so, nothing happens. RuneLite logs:
2022-08-07 11:52:53 [pool-3-thread-1] INFO com.worldheatmap.WorldHeatmapPlugin - Saving 'Type A' .heatmap to disk... 2022-08-07 11:52:53 [pool-3-thread-1] INFO com.worldheatmap.WorldHeatmapPlugin - Finished writing 'Type A' .heatmap to disk after 238 ms ... 2022-08-07 11:57:24 [pool-3-thread-1] INFO com.worldheatmap.WorldHeatmapPlugin - Saving 'Type A' heatmap image to disk... 2022-08-07 11:57:28 [pool-3-thread-1] ERROR n.r.c.util.RunnableExceptionLogger - Uncaught exception in runnable com.worldheatmap.WorldHeatmapPlugin$$Lambda$443/0x43c1ca28@fe66c3 java.lang.OutOfMemoryError: Java heap space
It's the same with "Type A" and "Type B"
Same issue here. I don't get an image write. It's just a .heatmap file
@HeyJacob Could you please try disabling every plugin besides World Heatmap and then writing an image to see if the problem persists? I think that the problem might be that users with other memory-intensive (or simply many) plugins running might run out of available memory when the World Heatmap plugin loads/writes an image, which means that the plugin works for (perhaps) most users, but never for some. It would also be very valuable feedback if you could share the list of plugins that you have running. Thank you for your help.
(P.S. I have a new update that makes the plugin require much less memory. Before I publish the update, I have to replace a dependency disallowed by RuneLite with a homemade version which will require me doing some research on manually writing PNGs chunk-by-chunk. Once it's ready, then even users with lots of plugins should not run into heap space overflow problems such as that mentioned in this issue (if I'm right about the nature of the problem).)
Could you please try disabling every plugin besides World Heatmap and then writing an image to see if the problem persists? While running RuneLite with no plugins, it works. But not with other plugins enabled.
It would also be very valuable feedback if you could share the list of plugins that you have running.
Im getting this same error, I click write image and nothing happens
I also have this issue
The error sounds more pervasive than I thought at first (sounds like it's possibly effecting every user). I've been meaning to investigate and fix it for a long time, but have been pretty biz with university stuff. Anywhomst, don't worry I will fix it some time in the next couple of months. Thank you all for the interest.
P.S. I should mention: The heatmap data itself is probably indeed being saved/kept track of for you all (despite the image saving not working). So, when I fix it, you guys should be able to see your progress if you've been running the plugin.
@Mintaras1 Also thank you for ze video and list of plugins
P.S. I should mention: The heatmap data itself is probably indeed being saved/kept track of for you all (despite the image saving not working). So, when I fix it, you guys should be able to see your progress if you've been running the plugin.
I would say you are correct as the file is still getting updated.
Any updates to this?
@Nick2bad4u Not at the moment, sorry. Still busy with school stuff but I'm rooking forward to fixing it before too long
@Nick2bad4u Not at the moment, sorry. Still busy with school stuff but I'm rooking forward to fixing it before too long
I did some troubleshooting. and thought it was a permissions error on the folder but that does not seem to be the case as I set permissions to wide open on the entire folder.
Not sure whether that helps or not.
In the folder called Heatmap Images you can rename the username_TypeA file to end with ".png" and you will get the image. Doesn't seem to work for TypeB.
In the folder called Heatmap Images you can rename the username_TypeA file to end with ".png" and you will get the image. Doesn't seem to work for TypeB.
I tried this and neither one works. Trying to open the PNG just gives me a corrupt file error.
As far as the heatmap images folder - I dont have one at all due to it now writing anything when you try to get it to generate a heatmap
In the folder called Heatmap Images you can rename the username_TypeA file to end with ".png" and you will get the image. Doesn't seem to work for TypeB.
I tried this and neither one works. Trying to open the PNG just gives me a corrupt file error.
As far as the heatmap images folder - I dont have one at all due to it now writing anything when you try to get it to generate a heatmap
Make sure you're in the Heatmap Images folder and not the Heatmap Files folder. From your screenshot the name of your files are ending in ".heatmap.png" which suggests you are in the Heatmap Files folder. The files ending in ".heatmap" should be left alone as these are not images.
In the folder called Heatmap Images you can rename the username_TypeA file to end with ".png" and you will get the image. Doesn't seem to work for TypeB.
I tried this and neither one works. Trying to open the PNG just gives me a corrupt file error.
As far as the heatmap images folder - I dont have one at all due to it now writing anything when you try to get it to generate a heatmap
Make sure you're in the Heatmap Images folder and not the Heatmap Files folder. From your screenshot the name of your files are ending in ".heatmap.png" which suggests you are in the Heatmap Files folder. The files ending in ".heatmap" should be left alone as these are not images.
Correct!
The issue is the heatmap images folder doesn't exist for me. Even after clicking write image.
Hello All, I have a shadow JAR aka a preview of the World Heatmap update/fix which you can test out downloading it here and then running java -jar -ea worldheatmap.jar
on it in a terminal. I would recommend making a backup of your ~/.runelite/worldheatmap folder (it's in your home directory) before testing it, just in case something were to go wrong and your original .heatmap files disappeared or something (don't remove it, just make a backup copy of it somewhere)
It would be super coolio if some of you could test it out and tell me if there are still any problems. Also there are some new features. One of em is a heatmap combiner tool that can be used to combine .heatmap files that were saved under different usernames, because originally I forgot to take into account that people's usernames can change. Now, the heatmap files go by unique player ID (and the image filenames properly end with ".png")
Hello All, I have a shadow JAR aka a preview of the World Heatmap update/fix which you can test out downloading it here and then running
java -jar -ea worldheatmap.jar
on it in a terminal. I would recommend making a backup of your ~/.runelite/worldheatmap folder (it's in your home directory) before testing it, just in case something were to go wrong and your original .heatmap files disappeared or something (don't remove it, just make a backup copy of it somewhere)It would be super coolio if some of you could test it out and tell me if there are still any problems. Also there are some new features. One of em is a heatmap combiner tool that can be used to combine .heatmap files that were saved under different usernames, because originally I forgot to take into account that people's usernames can change. Now, the heatmap files go by unique player ID (and the image filenames properly end with ".png")
I will try this out tomorrow.
So I tried it out but I cannot log in because I use jagex launcher, and the command above tries to launch runelite manually and not via jagex launcher.
Can you compile the plugin so I can add it as a plugin to my current runelite folder?
So I tried it out but I cannot log in because I use jagex launcher, and the command above tries to launch runelite manually and not via jagex launcher.
Can you compile the plugin so I can add it as a plugin to my current runelite folder?
You can follow these steps and then when you do the java -jar -ea worldheatmap.jar
, it'll start up with your account logged in as per the usual jagex launcher way. Thanks again for helping to make sure it's working 😎
So I tried it out but I cannot log in because I use jagex launcher, and the command above tries to launch runelite manually and not via jagex launcher. Can you compile the plugin so I can add it as a plugin to my current runelite folder?
You can follow these steps and then when you do the
java -jar -ea worldheatmap.jar
, it'll start up with your account logged in as per the usual jagex launcher way. Thanks again for helping to make sure it's working 😎
Thanks.
It worked.
So I tried it out but I cannot log in because I use jagex launcher, and the command above tries to launch runelite manually and not via jagex launcher. Can you compile the plugin so I can add it as a plugin to my current runelite folder?
You can follow these steps and then when you do the
java -jar -ea worldheatmap.jar
, it'll start up with your account logged in as per the usual jagex launcher way. Thanks again for helping to make sure it's working 😎Thanks.
It worked.
Awwww yeah 😎Sweet. I'll close this issue now, since the bugs have presumably been fixed by the update. It'll probably take a week or two for the update to get through the RuneLite code review and then it'll be available on the client plugin hub
Amy idea when this update will hit runelite?
Amy idea when this update will hit runelite?
Yeaahhh I made the pull request for the update and then realize there was something I need to change (may or may not be significant) and had to cancel it. I'm on break so I'll repush it in the next week or two. Sorry about the delay boys
Amy idea when this update will hit runelite?
Yeaahhh I made the pull request for the update and then realize there was something I need to change (may or may not be significant) and had to cancel it. I'm on break so I'll repush it in the next week or two. Sorry about the delay boys
Thanks for update!
Neither manual nor automatic image saving don't save heatmap as an image. When trying to do so, nothing happens. RuneLite logs:
It's the same with "Type A" and "Type B"