Skip to content

Tag: java

OutOfMemoryError on 10000×10000 int array in eclipse

I was wrote a little scratch program to check the time of looping through a 2 dimensional array by rows or columns, since I remembered that one way was much faster for large data sets, but I couldn’t remember which way. I ran into an interesting error when I ran my program though. Now in my test I am us…

How to efficiently predict if data is compressible

I want to write a storage backend to store larger chunks of data. The data can be anything, but it is mainly binary files (images, pdfs, jar files) or text files (xml, jsp, js, html, java…). I found most of the data is already compressed. If everything is compressed, about 15% disk space can be saved. I…

where is array saved in memory in java?

If I have a function that in that function I declare: Where are arr and the whole array stored? heap? stack? Does it matter if the declaration is in some function or in main()? and let’s say I also have these command lines: where are arr[0] and arr[1] stored? Answer Memory diagram: Boxes are memory loca…

Read a Environment Variable in Java with Websphere

I’ve a little problem with Websphere application server 7.0 (WAS7) and the reading of Environment Varaibles. With TomCat, I’ve defined a variable as and I read it with a lookup on the initialContext : and it works! But with Websphere, I define a environment variable on the GUI but I can’t re…