MikeWitters.com
My $0.02 on stuff.
My $0.02 on stuff.
Apr 5th
At one of my clients we were seeing the occasional spike in memory usage of their portal server. We’ve even seen some of the dreaded OutOfMemoryErrors. Most of the memory growth was natural – due to the growing usage of the portal. The errors are not natural – so something had to be done. At a minimum we needed to layout some guidelines for the developers to follow from hence forward to keep from compounding the problem.
This is a single server environment, no clustering. Over the past couple of years, the technical leadership at the client wanted to focus on speed over memory usage. In general, this meant that instead of re-executing the action phase when a page needed re-rendered, items that were needed for rendering were thrown onto the session. This alone can be considered OK in some circumstances. If the objects are small and few then it’s not that big a deal. But in a portal, almost by definition, there are a lot of applications. So if a lot of applications start throwing objects all over sessions then it can become a problem pretty quickly.
In addition to the times where the objects were small and few, there were times when it was done out of performance necessity. In one instance, searching for items in a Domino ‘archive’ takes over a minute. The fact that this might be fixable some other way aside; this is not something one would want to have happen every time you re-render the page that this portlet sits on. So you store the items on the session. The next question is how many do you store? Do you store the entire result set? Hopefully you limit it to some reasonable size, but reasonable to who?
These are a small subset of what we laid out. Note: These are definitely not specific to portal applications.
Apr 5th
I actually own the JavaDotCom.com domain name. I bought it thinking it would be a clever name for a domain. After I bought it I thought about using it as my ‘home’ instead of mikewitters.com. I guess you can call me a chicken, but I decided it might cause me pain. I did some research on some domain name disputes and it is clear to me that the courts are on the side of business… especially when its BIG business. I figured with my luck I’d do something insanely intelligent (Luck I tell you) and people would flock to the site, only to have Sun Microsystems take it all away in court for using javadotcom.com. So even though I was operating a java dotcom (i.e. my own future company which would be based on java technologies) the courts would hammer me for infringing upon their trademarked name. So its mikewitters.com. Who the heck is going to sue me for that?
There is that dang Nascar Driver…..
Apr 5th
I know I’ve said it a million times, its not really blog-ish content, and its documented ad nauseum all over the place, but you really need to use a StringBuffer when building large String objects from smaller String constituents. I have run across some issue with it lately so I want to add my contribution to the cause for anyone who may read this.
Take the following:
String dog = "The dog";
String cat = "the cat";
String action = "chased";
String sentence = dog + action + cat;
This code produces “The dogchasedthe cat”;
Its ugly, but I want to illustrate the big issue here.
The above code has produced 5 Strings:
“The dog”
“the cat”
“chased”
“The dogchased”
“The dogchasedthe cat”
Each of these is an object in the JVM taking up memory. And this is a very simple scenario. If we do some simple improvements that would be necessary to make this code usable look what happens:
String dog = "The dog";
String cat = "the cat";
String action = "chased";
String space = " ";
String sentence = dog + space + action + space +cat;
This code produces “The dog chased the cat” and it produced 8 Strings:
“The dog”
“the cat”
“chased”
” ”
“The dog ”
“The dog chased”
“The dog chased ”
“The dog chased the cat”
Imagine if you are forumlating complex SQL or XML using inputs from a web form. You could create hundreds of strings per request. Its just a bad practice. Make sure you use StringBuffer.
Apr 3rd
Well, hindsight being 20/20, I sure wish I would have spent the $5k more on my house to have a 3 car garage. It seemed like a lot at the time, but it would cost me about $20k to add it now. So my woodworking shop is in the basement and all my outdoor equipment (Mower with 48? deck, lawn sweeper, mower tow cart, snowblower) is in the garage along with all the other accumulated stuff. There’s barely enough room for the cars.
We’ve had enough. We’re getting a ’storage building’. The choices are many. There are several styles, several sizes, and tons of options. They start at $1200 and before you know it you’re sitting at $5500 – more than the cost of the 3rd bay of a 3 car garage.
There are at least 3 issues to take note of in this scenario. I haven’t thought deeply about all the aspects of this, but here are a few of my initial thoughts.
Issue 1 – Initial investment is cheaper
If I would have just sucked it up and made the initial investment of $5K I would have griped for a few days then I’d have been done with it. Instead I have to spend time deciding what to do and then spend nearly the same amount to get something thats not as good. I have seen companies do this same thing many times when it comes to software. I guess the difference is the amount of money. I’m spending a few thousand while I’ve seen millions squandered by ill advised managers.
Issue 2 – The fit of a future solution
A few months after we moved into the house we had a 3 post fence put in. This is no small thing. We have just under 2 acres and the fence covers the entire back yard. If we buy a prebuilt storage building, it’d be nice if we could actually get it into the back yard. This presents a problem. A 12 feet wide barn isn’t fitting through a gate thats ten feet wide. I’m going to have to remove a fence post to double the width of the opening so we can fit a wider ‘barn’ through. This is akin to a company trying to integrate a solution into their current environment. It is no fault of anyone that a future requirement causes pain in integrating with past solutions, but it illustrates the value in knowing the plan up front.
Issue 3 – The choice
I pretty much know what I want, the question is whether to build it and
A company can:
Sure, there are some other options, but generally these are it. Resources are being spent, no matter which way its done.
There are a lot of decisions that I’ll have to make before I decide which way to go. In all likelihood I will not build it myself. I’m handy enough, and have enough favors to call in to get it done, but my time is probably worth enough to me and my family to just have somone else do it… on the other hand, it is a great stress relief to do this kind of work for me, so who knows. I sound like a client. Indecisive.