Week 2: 209.2; Four down, thirty-six to go

Lost approximately 4 pounds this week. This is good. I was expecting the first 5-8 pounds to come off quickly, and I’m shooting for an AVERAGE of 2 pounds over 20 weeks. I need to see if I can get a quick fat-axe before shot… Actually, I ought to take one weekly so that I can run them together as an animation. Now THERE’s a creepy idea!

/w

June 30th, 2008, posted by Willy

2 lbs/wk, 20 weeks

That’s the new goal. Currently, I’m operating purely in the realm of diet changes. I’ve cut out alcohol altogether, and also fried, greasy foods. No more cheeseburgers.

Yesterday was Week 1, Day 1. Week 1 Weight: 213.

Target weight: 173.

/w

June 24th, 2008, posted by Willy

Return To Forever…

Last night I was lucky enough to attend the Return To Forever concert at Kingsbury Hall. Simply amazing. These 4 dudes, who were on the forefront of the invention of jazz-fusion 25 years ago, walked in, sat down and played some of the hottest, groovingest music I’ve ever heard. The same material from a quarter of a century ago, and it still sounds fresh and hipper than almost anything else out there at the moment. I was almost able to arrange a lesson with the drummer, too.

Chick played in his customary style. Lots of crazy, processed synth. Chick’s technique and soloistic approach are distinctive, and he certainly didn’t disappoint. Stanley Clarke was the other real standout of the show, in my opinion. They played a set with him on upright bass, and he took an extended solo… during which, frankly, I’m not sure WHAT happened. I’ve never seen anybody play the instrument like that. I was sincerely afraid he was going to break it. Apparently there are examples of similar stuff from him on youtube. I’ll check that out and post it.

Anybody who’s going to be in position to see this tour who likes music AT ALL owes it to themselves to go see these masters do the funky fusion.

/w

June 5th, 2008, posted by willyray

Java Threads and the -Xss Stack Size argument

At the office we’re having a memory-management issue on a very large multi-threaded application. Basically, we’re throwing so many threads that we’re running out of native heap space. We don’t seem to be having Java heap problems, the issue is within the 2GB process space limitation on a 32bit Windows machine. So, after considerable research, I’ve stumbled upon what I think might be the solution.

It seems that when a Java process spawns a new thread, it allocates a section of memory called the Thread Stack in the native process space. It’s basically setting aside resources for the thread to do whatever it needs to do. This is outside of the Java heap, but within the JVM runtime process, and therefore inside the native heap provided by the JVM’s host OS.

Internet sources vary on the default size of the thread stack, and it may vary from OS to OS, but I’ve seen people claiming the default thread stack size is 8k up to 32k per thread, regardless of the actual stack size requirements of the thread in question. So, depending on the complexity and size of the code in the thread, there may be a ton of resources being allocated that are just going to waste.

Here’s the little test app I ginned up to check this stuff out.

net/willyray/tests/threadage/MyThread.java

package net.willyray.tests.threadage;
public class MyThread implements Runnable {
	private int threadNumber;

	public MyThread(int threadNumber) {
		super();
		this.threadNumber = threadNumber;
	}
	//each thread will loop 100 times, printing out
	//it's number and how far it's gotten in the loop.
	public void run() {
		for (int i=1; i<=100; i++){
			//this whole sync-ed section executes
			//before the thread sleeps
			synchronized("synckey"){
			System.out.print(this.threadNumber);
			System.out.print(":");
			System.out.println(i);
			}
		}
	}
}


net/willyray/tests/threadage/ThreadDriver.java

package net.willyray.tests.threadage;
public class ThreadDriver {
	//create a certain number of threads and start them running
	public ThreadDriver(Integer numThreads){
		for (int i = 0; i<numThreads.intValue() ; i++){
			MyThread mt = new MyThread(i);
			Thread t = new Thread(mt);
			t.start();
		}
	}
	public static void main(String[] args) {
		if (args.length  != 1) {
			System.out.println("Usage: $gt;java -Xss
                                                   ThreadDriver “);
		} else {
		ThreadDriver td = new ThreadDriver(Integer.valueOf(args[0]));
		}
		}
	}

If I run ThreadDriver from the command line like so:
>java net.willyray.tests.threadage.ThreadDriver 10000
it creates 10,000 threads of my little counter class, and each starts counting, vying for processor time, and slowly making their respective ways up to a count of 100. I watch my Task Manager->Processes window, and I can see the Java process immediately skyrocket up to about 150,000k worth of memory usage. This is the highest on my list, topping both Eclipse and Firefox 2.

If I run it like this:
>java -Xss1k net.willyray.tests.threadage.ThreadDriver 10000
The -Xss1k argument tells the JVM to set the default stack size to 1024 bytes. I still fire the same exact code, doing the same exact work, but now my process runs in around 50,000k of memory.

Programming lesson: Sweat the small stuff, don’t trust the documentation, and take all questions immediately to the internet.

This Java memory management stuff is a real rabbit hole, but I find it kind of interesting. It makes a very perverse sort of sense when you really get down into the nitty-gritty of it.

Outstanding questions from this test rig: Are there performance hits from managing the threads in the smaller stacks? I can see where with less room to work with it might be a burden to manage the stack… still, at some point I’ll slap some kind of rudimentary timer on the thing and see what the results are.

Until next time…

/w

May 28th, 2008, posted by willyray

Washington D.C. -> Island Park, ID

Front porch of the cabin in IdahoYesterday was a big day. After a week of intellectually-intense web conference, I checked out of the hotel at 7:30am Eastern time, walked a half-mile to the McPherson Station, hopped a 15-minute metro ride to Reagan National, a 1h 35m flight to Cincinnati, then an almost 4 hour ride to Salt Lake City. At which point Becky picked me up for a 4 and-a-half hour ride to the ancestral cabin in Eastern Idaho to meet my parents and Charlie. All in all, the total travel time from the moment I checked out of the hotel to the time I arrived at the final destination (including the Kentucky layover) was approximately 14 hours and 30 minutes. Suffice it to say, my sitting-bones were hurting by then.

Hotel Helix - My room looked just like this.DC was generally good. Got in Saturday, and my man Rudi picked me up and drove me to the bizarrely-decorated Hotel Helix. My room looked pretty much exactly like the picture. Funky! The first two days of the conference were focused on ColdFusion, which is my core professional competency. These days were particularly useful to me, in terms of being able to mine the ideas of some of the heaviest hitters in the industry for the latest and greatest ideas. The next three days were about Adobe Flex which is an emerging technology (despite being on version 3) that puts the power of the Flash Player into the hands of non-developers in a useful and not-prohibitively-expensive way. I was less familiar with Flex, and many of the topics assumed a higher level of knowledge than I had. Still, I was able to re-jigger my schedule to get more “fundamentals”-based sessions.

Also, there were several extra-curricular activities that merit mention:

On Monday night continued my pattern of public drunken obnoxiousness that will eventually get me in terrible trouble. Main character from the film \"Thank You For Smoking\"I met a cool old hippie dude at the bar who happened to be the VP of the Federal Employees’ Union. Then, moments later, I met a chemical company lobbyist, whom I promptly lit into as a scourge on the political landscape of the country. I knew I had crossed some kind of line when the old hippie was defending the lobbyist against my verbal onslaught. I think it was about the time I asked the bottom feeder how many people his company had killed this year.

Headache Tuesday, then met Rudi for a taste of real DC culture. Specifically a “chili half-smoke all the way” at Ben’s Chili Bowl. Hell of a chili dog, there.

Wednesday, I went out on walk-about. Saw the White House and various other landmarks. Good times.

Tim and Willy at a barThursday I met up with a guy who’s aquaintance I had made on various drum-related internet fora, and who had always struck me as a righteous dude. Tim H. and I met up at Union Station, got a beer and some happy-hour appetizers, then wandered a bit, then found another beer (or 10) in a nice little bar with a guitarist in China Town. Good times, and good to meet a former figment of my imagination in the flesh.

Friday I stayed in, mostly, except for an excursion to the 7-11 and the Subway for a meatball sub. Good times.

/w

May 25th, 2008, posted by willyray

Rock-it!

May 14th, 2008, posted by Willy

Lot’s been goin’ on…

.. and I haven’t exercised since my last entry. :( The week of the last Monday in April I spent in a suburb of Seattle, WA at a 5-day Java development training class. Excellent content, though the instructor was a little weird. Dude looked like a cross between Penn Jillette and Fred Thompson. His politics were just touch to the right of Rush Limbaugh, too, and he insisted on being right about everything, whether it was related to the course material or not. Still, I learned a lot, and from having read half-a-dozen java BOOKS, I have to say, wack-job instructor or not, there’s value in instructor-led learning.

Anyway, here’s how this happened: The project manager for my team came to me (the only real “programmer” in the group) and said, “Willy, it seems like we need to hire a Java dev. Is that right?” and I said, “Well, this is the VA. You could spend 6 months making a hire, or you could send me away for a week.” My logic won the day, and when we tried to book the training locally, the company told us it was canceled, but that they would pay travel and lodging for me to go to Seattle. Done deal.

So, now I’m a Java developer. I spent all of last week working on a java project (an annotation tool for comparing original text to machine-processed text) so that I could make sure I “had it”. Now I’m sure I “have it”, and I’m demo-ing last week’s work to some collaborators in Indiana tomorrow.

Next week I’ll be in Washinton D.C. at the Web Maniacs conference learning about the latest and greatest ColdFusion stuff, as well as Adobe Flex and AIR. Exciting stuff that frankly rivals Java and .NET and all the others for integrated Desktop and Internet experiences. We’ll see if it’s useful for the job right away or not.

An interesting note: The best deal on a hotel within walking distance of the conference was the Hotel Helix. Check it out. It’s like a 60’s-hipster themed hotel. I just needed a place to lay my head at night, and instead I’ll be staying here. Crazy. More later.

/w

May 13th, 2008, posted by Willy

Exercise:

40 minutes on the stationary bike. This time it was Frank Zappa And The Mothers Of Invention. Worked pretty well to keep my mind off it. After that, I did arms and core.

April 11th, 2008, posted by Willy

Zappa Kick

One of my colleagues at the VA was in my office the other day. She said, “You know who my favorite drummer is?”

I said, “Are you sure you really want to tell me? Because I’m liable to judge you fairly harshly.”

She said, “Oooh. Um, now I’m not sure. I’ll tell you anyway. Terry Bozzio.”

At first, I wondered if I was being set up. Like, I was going to say, “OMFG, really? Terry’s the BOMB!” and then she was going to say, “you geek.” and punch me in the arm or something.

So, instead I said, “What? Are you a Zappa fan?”

She says, “Oh yeah. I love the Baby Snakes album.”

“Ok then,” I said, “You know, you’re alright.”

So, now I’m on a Zappa kick. I’m going to start at the beginning with the Zappa and The Mothers Of Invention album, “Freak Out!”, and refresh my memory of the whole catalog. My current sense of my favorite Zappa albums: Joe’s Garage and Thing-fish. I’ll be posting a bit as I go along about my experience of all these albums.

/w

April 10th, 2008, posted by Willy

Exercise

30 minutes of cardio, worked on upper body. I find the best thing to have on my iPod for the stationary bike is This American Life. Too bad it’s only new once a week!

/w

April 9th, 2008, posted by Willy