Month: August 2011

Delivering presentation w/o eye-contact sucks

August 29, 2011 Presentation No comments

On Thursday 18 August I delivered presentation on Software Estimation. Mainly I went thought the agenda that more-or-less matches contents of the book “Software Estimation: Demystifying the Black Art”, as I found it covering most of the main aspects of the estimation. I prepared a lot of interesting stories and analogies to explain stuff and presented that with great dedication… but… my audience was connected on the phone (except of two in room with me) and we did not have web cam (our IT dep. failure)… so… it really sucked.

I simply cannot know if they accept words and jokes I produce, thus I cannot understand if I have do adjust my speech. Also it is not possible to know if audience gets information easily or it goes hard. Asking audience different questions and getting response from them is also hard. Much more conversation was going between me and two people in meeting room. Long story short, when there is no visual feedback presenting information makes me, as presenter, frustrated. Of course it is not secret that it is important to have eye-contact with audience, I just wanted to complain a bit.

Ok, as we live in bureaucracy and connected world, there was feedback – filled survey. And you know what? It s***ed again – I got only 3 records in survey, even they are very positive (except complains on work of IT) it means only one thing – my audience didn’t admire the presentation. I won’t be surprised if 2 of 3 responses are from guys listening to me in the meeting room.


No comments


Just upgraded to AutoMapper 1.1 RTM

August 24, 2011 AutoMapper No comments

Just upgraded AutoMapper to 1.1 version. What is really funny about this update is that we used pre-release version of this tool in production. And it worked well, even there were some bugs, so I’m having some doubts if we relied on some of those bugs : ).

Here are Release notes we should benefit from:

For the 1.0 RTM: http://automapper.codeplex.com/releases/view/39791 For the 1.1 RTM: http://automapper.codeplex.com/releases/view/44802

Honestly I did not find some major changes and there were no obvious (compile error) breaking changes, even we used many of AutoMapper features. There are slight performance improvements and added features that we probably don’t need or maybe need. Thus I would like to complain about AutoMapper a bit – it is lacking documentation. Sometimes it is much easier to read about some feature and realize “aha, great, now we can utilize this capability!”.

There is only one hint to upgrading process I would like to add. When upgrading version I guess you would usually replace path to assembly in all *.csproj, but don’t be lazy and do full search in other files, as you might have different build/deploy scripts that push 3rdParty components to appropriate folders.


No comments


Upgrading to higher version of NHibernate w/ FluentNH

August 23, 2011 NHibernate No comments

“How much would it take?” – Yeah, it is interesting question, which we gave to ourselves being maybe 3rd year of developing projects based on NHibernate. We took quick look and from top of the head it looks like it would take a lot of time, because FluentNhibernate has changed syntaxes, because there might be something not working after changes, etc.
You know what? I was able to change version of NHibernate and make it working for us within 25 minutes.
It just proves known statement about giving estimates: Judge as last resort!” Better compute and much better count if applicable.
So what is needed to be changed when you are upgrading to higher version of NHibernate w/ FluentNHiberante (from 2.0.0.4000 to 3.1.0.4000):
  1. Download compatible versions of NH and FNH. Usually FNH is step behind. (see release notes)
  2. Update references of your projects if you have folders for versions of 3rdParties.
  3. Update fluent initialization of NH with adding proxyfactory, like below:

var configuration = new Configuration();
var properties = new Dictionary<string, string>();
properties.Add(“proxyfactory.factory_class”, “NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle”);

4. Also you would need to reference NHibernate.ByteCode.Castle in your starting project.

5. Update fluent mapping with removing different noise code like below (if you are below 1.0 version):

image

We had about 250 mapping files so “Ctrl+H” had to be used a lot.
6. Run your application and see if you don’t have any issues.

So, long story short, updating to higher version of NH is not painful. It is still not clear if it has big impact or not, especially for big project.
If we decide to upgrade I will let you know if testing shows big impact.


No comments


My 200th blog post. Sometimes it is hard to blog.

August 22, 2011 Uncategorized No comments

Hello. Officially this is my 200th blog post.

In my “100th blog post” I wrote that blogging pays off and indeed it brought me many cool things, like knowledge, opportunities, also I became noticeable by others in my company.

In that hundred posts I finished my series on design patters. I prepared for being senior developer and became him. I delivered many presentations, including one big it-jam. I wrote few popular posts on career plan and interviews. I had many other not less interesting posts.

It took me 9 months to have those first 100 posts and now I see that next portion took me over year. Interesting… when will I get my 300th post. Would it take year, less, or more? I cannot answer, but I know that blogging started to be hard for me. Not because I don’t have things to blog about, but because I don’t stop myself for few moments to write about something. Almost each day I have some challenges at work, I can blog about. I read many interesting stuff, which I can try out and blog about. But I don’t.

I know, I know real blogger shouldn’t write such posts. And I wouldn’t even try to convince anyone that I’ve been very busy or something… I had lot of routine stuff that many people have all their life. I had nothing unusual but for some reason lost feeling of the road I’ve decided to take. Why did I?

I have disease – I often think that I will do the stuff later, maybe in the evening or tomorrow. And when I think so I do nothing next day. It is damn stupid habit. For the dozen of weeks I thought that I will post latest 2 design patterns, but I did not. Some time passed and I had them on my blog, but it was too hard.

Why do I think that I will do all the stuff tomorrow? It is not possible. There are guys at work that never think that way. They are so much responsible, they fill that cannot left working place until some good portion of their job is done. WTF? Why I don’t have such skill?

I probably didn’t read my blog for some long time! I need to! Here is something that gives me some advices on how I should proceed.

Where have I been? Nothing is going to be tomorrow if I do nothing today!

I DO NOT LEAVE THINGS FOR TOMORROW!!!


No comments


Book Review: “Software Estimation: Demystifying the Black Art”

August 17, 2011 Book Reviews No comments

imageFinally I have another post on read book (after so long time not reading posting). This time book is on software estimation called “Software Estimation: Demystifying the Black Art”.

This is first book that I read about estimation end-to-end, and I have to say that it is extremely good and I think it covers most of the topics needed to be able to see how estimation works.

It consists with three parts, each gives you good set of knowledge, first one on core concepts, second on fundamental techniques and third one on challenges you might dive in when estimating.

Honestly I started to read this book, because I knew that I will have presentation/training to deliver. I heard about most of the concepts mentioned in book, but (!) book gave great insight into them and from different perspectives so I started to wish that I had reconsidered all of the many estimates I gave in the past.

I would really recommend you to read this book as it helps you to think deeper when working on estimates.



No comments


WCF Configuration caused memory ‘leaks’

August 17, 2011 Performance, WCF 10 comments

If you are lazy to read whole post, jump to “Summary”.

Have you been in situation when a project was designed for low performance needs and in the end of the day customers want it to be 100 times faster? You have to be ready for such time and be ready to scale.

We changed the configuration of our application for more aggressive processing but it did not meet customer needs, so we had to do much more other tweaks to make our service performing better. Unfortunately along with with improvements we started to get memory leaks.

So our app started to eat memory dramatically. Within 5-15 minutes it was already hitting 2Gb score. Why the hell? Most of the changes were configuration and performance tweaks.

I decided to profile the application with ANTS Memory Profiler. (by the way it is simply amazing profiler). After I learned what means what in the profiler, I was able to analyze what I see. Turns out our application produces huge memory fragmentation with large objects. (see screenshots below)

Here are some recommendations for fixing such issues from profiler website:

Solving large object heap fragmentation

Large object heap fragmentation can be one of the most difficult types of memory problem to solve, because it often involves changes to the architecture of the application. The best approach to use will depend on the exact nature of your program:

•Split arrays into smaller units so that they remain below 85kB (and so are never allocated on the large object heap).

•Alternatively, you can allocate the largest and longest-living objects first (if your objects are files which are queued for processing, for example).

•In some cases, it may be that periodically stopping and restarting the program is the only option.

So what are these large objects? My initial thought was that out app simply was not keeping up with processing and we overloaded memory with many large collections that were not garbage collected.

clip_image002

But what was interesting was this funny  Byte[] array keeping 134Mb of memory… I drilled deeper and found the following:

image

Oh, System.ServiceModel.Channels.BufferManager! This made me thinks that large objects are actually allocated by WCF and never disposed, so in the end of the day it was causing our memory leaks.

So I knew that it is something related to WCF BufferManager. I started looking at what was changed in WCF configuration in order to process bigger messages. Here is what I found:

<binding name=”Allscripts.Homecare.WSHTTPBinding.Configuration” closeTimeout=”00:05:00″ openTimeout=”00:05:00″ receiveTimeout=”00:10:00″ sendTimeout=”00:05:00″ maxBufferPoolSize=”2147483647″ maxReceivedMessageSize=”2147483647″>
<readerQuotas maxDepth=”2147483647″ maxStringContentLength=”2147483647″ maxArrayLength=”2147483647″ maxBytesPerRead=”2147483647″ maxNameTableCharCount=”2147483647″/>

Do you see anything interesting about the configuration above? Yes, all values are set to max. What are chances that someone really evaluated their impact on performance before setting everything to max? Max is always better. Isn’t it? maxBufferPoolSize property is related to BufferManager. A bit of a search and I found this:

From http://kennyw.com/work/indigo/51 :

“On the built-in WCF Bindings and Transport Binding Elements, we expose MaxBufferPoolSize as a property for you to control our cache footprint. If you are sending small (< 64K) messages, then the default value of 512K is likely acceptable. For larger messages, it’s often best to avoid pooling altogether, which you can accomplish by setting MaxBufferPoolSize=0. You should of course profile your code under different values to determine the settings that will be optimal for your application.”

So with changing maxBufferPoolSize to 0 I was able to witness stability in the work of our service. Of course, it was still consuming some memory because of hard time we gave it, but it was not leaking.

From the picture below you can see that there is no problem with Large Objects Heap. It was nicely bumping up and down (blue line).

image

 

Summary

If you have performance problems, and try to fix them by changing all configuration parameters (timeouts, buffer sizes, other stuff) do this carefully. Always evaluate the performance impact. If you already have problems, use advanced profilers.

Surprisingly, increasing WCF maxBufferPoolSize doesn’t always mean increase in performance, rather it can result in huge memory leaks if the size of your messages is larger than 64K. For larger messages it is better to set MaxBufferPoolSize=0. For me it sounds like GC is not so keen on disposing large objects from heap and this caused our issues.

Hope this helps someone.


10 comments


Visual Studio 2010 hangs during installation…

August 15, 2011 VS2010 2 comments

Today I spent good porting of time trying to downgrade my VS2010 from Premium to Professional edition.

When I run VS install I got following hanging:

image

I had to wait about 20-30 minutes to get to the next step. So I tried to kill process are restart again, reboot PC and other things. Of course I did research over internet and it gave me much hints, but not complete solution.

Maybe it is only solution for my particular problem, but it also might be your problem.

1. Download Process Monitor and start spying your setup.exe.

2. Find out root causes of hanging.

image

3. Resolve issues. In my case those were missed registry keys, which I had to manually create and locked files – I had to kill processes using them. I also discovered that some of the issues were related to IE settings, so I put all to defaults, cleared all history/cached data.

4. If it doesn’t help, continue your research. For me this one post was very useful.

Hope this helps someone.


2 comments