Thanks BrowserUK for your response: 1>I am getting the warning as "Warning: the specifed memory size is being reduced to the available paging memory".The paging file size of this system is set to 12284 MB.(Even when I run this on w2k8 64 bit 12GB RAM system)(Let me know if I need to change the paging file size) 2>The output of sort which you have mentioned and output of my code differs when the date and time is same.With the sort option you provided, the entire line is considered for sorting and hence the text lines after the date and time is also getting sorted(which I dont want text lines to get sorted when data and time is same).Is there a way to do it? I have attached the output of both sorts Your sort: 2012/12/13 @ 19:00:27,792 @ ,, at com. 2012/12/13 @ 19:00:27,792 @ ,, at com. 2012/12/13 @ 19:00:27,792 @ ,, at com. 2012/12/13 @ 19:00:27,792 @ ,, at java.lang.reflect.Method.invoke(Method.java:597) 2012/12/13 @ 19:00:27,792 @ ,, at java.lang.Thread.run(Thread.java:662) 2012/12/13 @ 19:00:27,792 @ ,, at sun.reflect.GeneratedMethodAccessor1387.invoke(Unknown Source) 2012/12/13 @ 19:00:27,792 @ ,, at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 2012/12/13 @ 19:00:27,792 @ ,, at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305) 2012/12/13 @ 19:00:27,792 @ ,, at sun.rmi.transport.Transport$1.run(Transport.java:159) My sort: 2012/12/13 @ 19:00:27,792 @ ,, at com. 2012/12/13 @ 19:00:27,792 @ ,, at com. 2012/12/13 @ 19:00:27,792 @ ,, at com. 2012/12/13 @ 19:00:27,792 @ ,, at sun.reflect.GeneratedMethodAccessor1387.invoke(Unknown Source) 2012/12/13 @ 19:00:27,792 @ ,, at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 2012/12/13 @ 19:00:27,792 @ ,, at java.lang.reflect.Method.invoke(Method.java:597) 2012/12/13 @ 19:00:27,792 @ ,, at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305) 2012/12/13 @ 19:00:27,792 @ ,, at sun.rmi.transport.Transport$1.run(Transport.java:159) 2012/12/13 @ 19:00:27,792 @ ,, at java.lang.Thread.run(Thread.java:662)