Manu Somasekhar

Ranch Hand
+ Follow
since May 22, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
21
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Manu Somasekhar

There is a mistake in my question.

Manu Somasekhar wrote:
2. If a minor garbage collection occurs in Eden space, a garbage object is moved to survivor 0.


This is wrong. In fact, during minor GC a dirty object is copied from one heap area to another if it is still in use. The reason for dividing heap memory may be(I am not sure ) the following.

Different objects may have different life spans. So placing them in a single heap space and running GC may not be an efficient idea. Instead, the heap is divided into segments and different GC algorithms with different execution costs are applied to each segments.

Please correct me if I am wrong.
9 years ago
Thanks Winston. That was very helpful.
9 years ago
Hi,
I know that java heap contain a younger and older generation. The younger generation is divided into Eden space, survivor 0 and survivor 1.
My doubt is,
1. What is the advantage of having such areas instead of having one single heap space ?
2. If a minor garbage collection occurs in Eden space, a garbage object is moved to survivor 0. Why to move a garbage object to the subsequent space instead of removing from memory?

Any Help is appreciated.
9 years ago
Thanks Pawel,Joanne, Henry.
9 years ago
I have a code snippet



I am getting the result as true and false. I don't understand why because both Strings pairs s1,s2 and s3,s4 are made from concatenations. Any help is appreciated.
9 years ago
Found a useful link for anyone interested

link
10 years ago
Hi,
From what I understood using mp3 encoding in your app require license. But I have seen some examples for implementing a music player app which plays MP3 files. Also there are many apps in Google Play which can process MP3 file like audio player, audio editors etc. So do I require to buy MP3 license for an app that process MP3 files?
10 years ago
Head First java by Kathy Sierra webpage
10 years ago
Hi Faraz,
Once you successfully set JAVA_HOME environment variable [Tutorial] using cmd tool of windows, go to the directory where your java files are located. type "javac Application.java" to compile your java code. It will produce a "class" file within the same directory named as "Application.class". Now you can run your java program using the command "java Application". Hope it helps
10 years ago
Thanks Marco,Derryl and Ivan. I got the point. Below code worked for me

10 years ago
hi,
I just want to make a package name from a dirctory name by replacing all path separators with "."



I am getting PatternSyntaxException Unexpected internal error near index 1
\
^

Any idea what is wrong with it ?
10 years ago