Skip to content

shuwair/IPGTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test for IPG

Requiremnt

Generate a file with x number of lines and each line consist of a string that is unique with 100 characters long with limitation of 10M of ram

Solution

  • Used Flyweight Pattern for passing strings and not stored in any array or list to save memory
  • String generated with the combination of counter and zero padding (eg .....0000001) so every string should be unique
  • Used BufferedWriter for writing generated rows to file with buffer size of 100 as each row contains 100 chars

Results

Successly generates file with x no of rows consists of unique 100 characters long string with less than 4m of ram untilize, results recoded with Jprofiler for 10 million rows genration

Strings generated

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002 ...... 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009999999 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000

Memory Utilize

alt text

Ojbect Details

alt text

About

Test for IPG

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages