There are 20,000 strings like this always loaded into memory and i want to do a patter matching on them, for example a request comes in to find string 'NAME' in the memory, so it will be like a wild card match, i should find following two records in the above sample. [MYNAMEISEARLHIKKI, MYNAMEISABCDABCD]
What will be the memory implications and performace implications of storing 20,000 records which are 150 to 200 character long and doing a find pattern matching on them, can you give me a simple code to load strings into memory
Actually not a lot less. It's 64,000,000 bytes, and the JVM has a default of 64MB (67,108,864 bytes). However, the JVM also needs memory for its default footprint (classes etc) and other objects, and will therefore quite easily exceed the 64MB. Therefore, you will need to specify a larger maximum heap size.
Originally posted by Satish Chilukuri: Good old bits/bytes mix up . Its 64,000,000 bits. So it will take around 8MB.
That was a pretty stupid mistake yeah.
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12265
1
posted
0
When you actually write the code, you will be surprised at how compact the serialized object is and how fast Java can create a HashSet from the serialized form.
My phonetic lookup demonstration has one dataset with 14 thousand keys and almost 60 thousand words. The serialized collection is only 871kb.