syvaidya / openstego

OpenStego is a steganography application that provides two functionalities: a) Data Hiding: It can hide any data within an image file. b) Watermarking: Watermarking image files with an invisible signature. It can be used to detect unauthorized file copying.
https://www.openstego.com
GNU General Public License v2.0
1.13k stars 206 forks source link

Consistently receiving Java Out of Memory Errors #40

Closed Rufusdotrufus closed 3 years ago

Rufusdotrufus commented 3 years ago

I saw this program and thought I would give it a try. I have run a number of tests. The first test ran fine.

Test 1. The image I used to hide my data was 474x296 pixels with a bit depth of 24. Using AES 128 encryption. Test completed.

Test 2. The image I used to hide my data was 9004x11590 pixels with a bit depth of 36. Using AES 256 encryption. Test never completed. I received the following error: java.lang.outofmemoryerror:java heap space.

Test 3. The image I used to hide my data was 2529x3522 pixels with a bit depth of 24. Using AES 128 encryption. Test never completed. I received the following error: java.lang.outofmemoryerror: GC overhead limit exceeded.

It seems to me there is a limit to the size of the image one uses to hide data within.

Also, it would be nice if the documentation included the fact you need Java installed to run the program. The wiki here on Github makes no mention of needing the Java runtime environment.

Thanks

syvaidya commented 3 years ago

@Rufusdotrufus which version did you use? v0.8.0 has a major memory usage fix.

Regarding Java usage, check https://www.openstego.com/features.html. Earlier, installer used to check for Java to be installed, but there were some issues with consistency of that check as Java can be installed in different ways on different OSes. So, now installer will go through, but when you execute ".bat" (or ".sh" or non-windows OSes), it should give message that Java is not available.

Rufusdotrufus commented 3 years ago

@syvaidya Thank you for replying so quickly. I had downloaded both v0.8.0 and v0.7.4. I thought I had installed v0.8.0 but I hadn't. I installed the most recent version and re-ran my test samples.

All samples ran quite quickly and smoothly with the exception of the largest image 9004x11590 pixel. That sample caused an out of memory error. I think the pixel resolution for that image is just too great for the program.

I appreciate your hard work on this interesting program.

syvaidya commented 3 years ago

To handle larger files, you can edit openstego.bat (or openstego.sh on MacOS/Linux), and increase value for -Xmx from default 1024m to higher number. For example, to allow up to 4GB memory usage, change it to Xmx4096m.