Tuesday, October 30, 2007

What is Memory Leak?

I have been assigned this task to create a new API for an application to access to grab data from a global repository. Actually there is nothing special about this API, it was just a simplified version of the existing API the application was using, just that too much unnecessary data was returned which had an impact on its performance.

After making the changes and doing the benchmarking there was a performance improvement of more than 100%. Sounds good eh... Then comes the endurance part, where the API is used constantly with a stable load for a period of few days and monitoring the memory utilization during this time. Monitoring work begins, first few hours looks good, no increase in memory usage but after that the memory increased gradually after a day. So I presented this findings to my colleague which was managing this "product". She said a memory leak occured for this new API. I was thinking to myself, how could this be, this is an existing piece of code modified to be better and there's nothing new about it. If this is a problem, then the current one running in production is also in trouble. I didn't want to argue, so I checked my piece of work properly to see whether I left out anything. It looks ok, nothing missing. She mentioned that the production one is running fine and was tested to be OK previously. So we decided to load the old API to test, the same results were returned.

Uh... so now what is the problem, she decided to consult the experts in performance tests, it seems like the garbage collection was not efficient enough to perform it's job on time. Therefore causing memory not in used, not released back to the system. After doing forced garbage collection, the memory utilization was back to normal :) Well, I am happy, I learnt something new on Memory management for software applications. It was worth all the trouble and difficulty doing this test.

Definition of Memory Leak, this is a snippet from Wikipedia:
"In computer science, a memory leak is a particular kind of unintentional memory consumption by a computer program where the program fails to release memory when no longer needed. This condition is normally the result of a bug in a program that prevents it from freeing up memory that it no longer needs.

The term is meant as a humorous misnomer, since memory is not physically lost from the computer. Rather, memory is allocated to a program, and that program subsequently loses the ability to access it due to program logic flaws.

As is noted below, a memory leak has similar symptoms to a number of other problems, and generally can only be diagnosed by a programmer with access to the program source code; however many people are quick to describe any unwanted increase in memory usage as a memory leak, even if this is not strictly accurate."

Monday, October 29, 2007

Assunta Alumni Summer Hunt 2007

We girls were excited after no hunt activity for a month. We were all raring to go. This time it was the Assunta Alumni Summer Hunt 2007. As for me, things had not been good since Saturday :(. I had a fall at the car workshop while servicing CH's car. Had to get his odometer fixed for the company's hunt in December. I sort of hurt my ankle. Then at night, I was having a bout of migraine attack. Grrr...didn't sleep well at all. Woke up at 5.40 am. Had a light breakfast and I was off to Sofia's place to lead her to our meeting point. We reached SMK Assunta a little bit past 7. The girls had some light breakfast and at 8.19 am, we flagged off. Things seemed to go wrong after we flagged off. No thanks to me, being the navigator, we lost our way after driving for a few kilometres. How embarassing and I was panicking. We decided to back track, and thanks to Lee Quan, she said she would take over the navigation while I be the passenger. We were back on track :) I apologized to the team for letting them down.

The rest of the journey was cracking our head and straining to look at all the signboards. There were 35 route questions - 30 normal questions and 5 bold question, and 4 treasures. The second last question was the hardest. It goes like this:
Q: Upright cover perhaps
A: Purple Star Group

When we reached that sector, there were already a lot of hunters there trying to crack this Q. As for us, still green in hunts, we got it wrong. hahaha... We just gave a tembak and drove back to the finishing point.

After submitting the answer sheets and treasures, we had to do a challenge. The challenge was counting grapes. I was like huh... we had to guess the number of grapes displayed, I don't know how many points we got for that challenge. There were 177 grapes. We only guessed it as 110. So was quite way off from the actual figure.

We had lunch and had to wait about 2 hours before the Q & A session. It was a tiring wait despite TOS having some games, eating the apples to kill off time. When the results were announced, we did not finish in the top 15, so no prize to bring home. The only consolation was winning RM 120 petrol voucher from BH Petrol for the lucky draw.

It was indeed a nice hunt and I felt that the team have improved from the previous hunt. Next stop, Sun Hunt on Nov 3.

Wednesday, October 24, 2007

How time flies

It's about a year since I tendered by resignation to leave APIS and rejoined in July this year. What a turbulent year it has been. It all started with me feeling bored as there was no projects for more than a year. The thought of venturing out and trying new stuff drove me to look for a new job. The job just came quite fast. I still dunno why I took all the trouble to secure this job. It was not that easy actually. First, I had to go through an interview followed by an exam to develop a sample application. And I passed and was offered the job immediately. Actually I still think I did a rash decision to take up that position. The package was rather attractive. Because of that, I may have lost my bearing. Moreover, the head hunter was also rather impatient, she wanted the deal fast, only gave me 2 days to decide whether to take up the offer or not. I felt a bit "cheated" from this aspect. So off to KLCC. It was a real nightmare for me. I had to wake up so early in the morning and leave home by 7 am. A big difference from the usual time I need to wake up for work. Driving to the LRT also takes around 40 minutes if the traffic is ok. The next big challenge was fighting for a place in the LRT. It is really packed early in the morning. I felt like I was going for war. By the time I reach the office, I am already a bit worn out. Going home proofs to be another challenge. The LRT at KLCC is packed again and the drive back from the LRT station to home is jam jam jam all the way. All in all, so much precious time is spent on travelling back and forth to work. After a few days there, I began to ponder, is this what I want?? After working there for about 2 weeks, I decided enough was enough and I left without a job :(

The next few months proved to be some challenge looking for another job. I did get a few offers, but this time, I was really cautious on what I am going to get myself into. After about 5 months being a housewife, I took up the offer from a local vendor based company. I was based at Putrajaya, working on a government project at the PM's department. Working there was another big nightmare. Don't want to elaborate too much on that.

My rescue came, when my ex-boss from APIS asked me whether I'll be interested to come back. Without hesitation, I took the offer to leave the current hell hole I was in.

Actually looking back the time when I was a temporary housewife, it didn't seem so bad. Doing all the housework, getting afternoon naps, monitoring stocks and occasionally cook. But the bad part is, you have less social life and can't simply spend money as you wish compared to when you are working.

Thursday, October 4, 2007

Timeout Challenge VII

Going for my first TOS motor hunt. I was feeling excited even before the hunt. My team mates were feeling the same too. One of them even thought the hunt was a week earlier. Another team member which had to work on night shift took half day off, to get some sleep before heading off to Malacca. That goes to show how keen we are on treasure hunting.

The day before was briefing day. Lee Quan and I were nearly the last team to arrive for the briefing. We were caught in such a bad jam it took us nearly 1.5 hours to reach the National Science Centre.

Hunt day, flag off was at the Regalia Business Centre car park. We were caught by surprise there were 2 legs for this hunt. Leg 1, walk hunt just a short one with 5 questions. We managed to finish that fast and headed off for the Sungai Besi highway to start Leg 2. When we arrived there, we sort of got confused with the roads and was practically lost even before Leg 2 was started. We decided to call TOS to ask for directions and actually we were just beside the answer for Q1. It was really funny, asking TOS we are now at Country Heights, are we at the right place. The guy on the other side, was like uh uh ... dun really know how to answer us as it was the answer for Q1. After we figured out that was answer for Q1 we burst out in laughter and continued our journey. It was quite smooth sailing until the part where the questions were positioned at the wrong tulip. Being novices, we hard some problem and did not know how to answer and decided to skip it and move on without realizing the answers were actually at the next tulip.

We reached the finishing point without any penalty. Results were announced but we did not win anything. I am not too disappointed as we are all still new and took this as a learning opportunity and to have fun at the same time. Our next stop will be the Assunta Hunt also by TOS on Oct 28.