Just thought running a grep on those daily musings - on mobile world mainly - might be amusing!
Tuesday, March 13, 2007
java.lang.OutOfMemoryError
Out of memory errors can be pretty tough to crack - especially on high volume applications. The main problem is the lack of tools that work well under heavy loads. Most commercially available tools that works nicely in development fails miserably under high load in the production environments. Unfortunately toughest of the OOMs show up only under production loads; that too usually over a period of time, thus making it next to impossible to reproduce them with the usual load/stress tests. One of the reasons why the commercial tools don't work very well under heavy loads is because they are extremely intrusive. This affects the JVM performance so much that the server CPU usually hits the wall the moment you turn on production traffic. The usual debugging mechanisms, such as rigorous code reviews looking for possible memory leaks and concurrency/performance issues, analysing access logs with error/application logs and verbosegc output, secluding suspect applications into separate JVMs etc helps, and should be sufficient to uncover the culprit code in most cases, but not always!
So what do you do when everything else fails?! Well.. welcome to the world of the amazing JVMPI/JVMTI APIs. Using JVMPI it is possible to put hooks into JVM to do things that are normally not possible in Java - things such as profiling Java heap, generating object allocation stacktraces etc. This extremely helpful information from the deep insides of the JVM is usually more than sufficient to crack the toughest of the memory leaks. The most important thing here is, unlike the commercial tools which are usually catch all (ie., track everything that happens inside the JVM) you get to pick and choose the specific events that you are interested in. For eg, you can tell JVM to notify only when an object of a particular type or size is created. Even more importantly, you get the ability to generate this information only when you want it. This really is the key to make this work in production environments - the fact that you can programmatically activate/deactivate the tool - to take periodic snap shots of the JVM heap or get allocation stacktraces for a single request etc. The trick is to implement an easily accessible switch that allows to enable/disable the JVMPI module as and when needed - could be as simple as a simple JSP page running in the suspect VM that hooks into the JVMPI module via JNI.
Sounds interesting and ready for a deep dive? Pl refer to the sample JVMPI utility at http://virtualmachine.de/ and the official JVM PI site.
Thursday, May 11, 2006
Friday, May 05, 2006
.mobi - good or bad?
Looking at the domain names of some of the popular mobile sites today, each of them seem to follow their own naming convention. This makes it almost impossible for a user to type in the URL directly on he mobile browser and expect to see mobile content, unless the site has server-side user-agent detection in place (like google.com for eg.) - which btw is not very maintainable in long term. The latest .mobi domains kind of addresses this problem as ICANN has placed content restrictions around .mobi registrations which mandates XTHML-MP content be served from .mobi domains. This enables a customer to confidently type .mobi URL - say company.mobi - and expect to see valid mobile content, without being worried about the possibility of getting flooded with the regular web content - wasting costly mobile data. Thus .mobi names do add value by providing initial navigation/getting users to the mobile site. However one could argue that users could use mobile search engines to get to the site rather than typing the URL in, but search results seldom guarantees that you get the right mobile URL.
On the down side, .mobi TLDs are not very mobile friendly in terms of the ease of use - 9 key presses just for the TLD alone isn't fun on a mobile phone.
Unfortunately standardization is something that isn't very popular at the moment in the mobile space - be it URLs, mobile content or even device browsers! Therefore adoption/non-adoption of this new .mobi standard in the mobile community is something we cannot predict right now but I do feel that getting the domains registered is the safest thing to do at this point.
On the down side, .mobi TLDs are not very mobile friendly in terms of the ease of use - 9 key presses just for the TLD alone isn't fun on a mobile phone.
Unfortunately standardization is something that isn't very popular at the moment in the mobile space - be it URLs, mobile content or even device browsers! Therefore adoption/non-adoption of this new .mobi standard in the mobile community is something we cannot predict right now but I do feel that getting the domains registered is the safest thing to do at this point.
Wednesday, April 12, 2006
Voice enabled apps
User input has always been a pain on mobile phones and always will be. I mean everybody wants to carry thinner and smaller when it comes to mobile phones. There is no way to incorporate a decent UI mechanism without sacrificing the size. Actually even in the moderately sized PDA touch screen phone with full expandable qwerty keypad that I carry (Cingular 8125), it is absolutely no fun when it comes to pulling out the stylus(or keyboard) and trying to input, say a userid/password combination.
This is exactly where the voice input comes into picture. It is so natural for one to speak into a mobile phone rather than try and type something into it. The critical factor ofcourse here is the processing power of the mobile phones - unfortunately no where near what it takes to run an efficient speech recognition system right now. Given the "size" factor mentioned above and the "battery life" factor it probably will never get there. However voice recognition is perfectly do-able on server side. With the appropriate tech on the device side to reduce the sampling rate thereby keeping bandwidth usage within limits and a sophisticated server side VR system probably with an add-on personalization engine, voice enabled apps could be definitely the next big thing in mobile space! Maybe voice enablement could be offered by the service providers to application providers - or there could be third party voice gateway providers similar to SMS providers. Or it could be application provider hosted just like regular VR gateways (secure apps would probably need to do this). There are tons of possibilities out there.
I wonder whether Google’s latest voice search patent has anything in it related to this.
This is exactly where the voice input comes into picture. It is so natural for one to speak into a mobile phone rather than try and type something into it. The critical factor ofcourse here is the processing power of the mobile phones - unfortunately no where near what it takes to run an efficient speech recognition system right now. Given the "size" factor mentioned above and the "battery life" factor it probably will never get there. However voice recognition is perfectly do-able on server side. With the appropriate tech on the device side to reduce the sampling rate thereby keeping bandwidth usage within limits and a sophisticated server side VR system probably with an add-on personalization engine, voice enabled apps could be definitely the next big thing in mobile space! Maybe voice enablement could be offered by the service providers to application providers - or there could be third party voice gateway providers similar to SMS providers. Or it could be application provider hosted just like regular VR gateways (secure apps would probably need to do this). There are tons of possibilities out there.
I wonder whether Google’s latest voice search patent has anything in it related to this.
Wednesday, January 18, 2006
Blackberry Woes
RIM blackberry can be pretty troublesome when it comes to deploying J2ME apps. First of all they have the custom .alx and .cod files instead of the standard .jad and .jar files. These need to be generated using the RIM supplied tools and IDE (which is not Eclipse based!) However the device will automatically do the conversion if you use OTA deployment. Then there is the weird blackberry form factor - very good for email, but sucks for J2ME developers. Well.. unless you are maintaining blackberry specific versions. I think the screens on the newer 710x series and 8700 series are much better when compared to the 7xxx ones.
Even bigger pain is the connectivity, especially if your app need secure connections (https/TLS, SSL). Given that the J2ME support for HTTP spec is only partial (lack of "official" cookie support, DELETE, PUT methods, 302 redirect response handling etc), RIM makes it even more difficult with their custom connectivity options. First of all, if you are an enterprise customer, you are almost certain to have Blackberry Enterprise Server (BES) enabled. In that case all your connections by default go into your corporate intranet via BES and in order to connect to the outside world, you need Mobile Data Service (MDS) enabled within BES! Sometimes enterprise policies might not allow enabling MDS service altogether or might be restricted. Even if MDS is enabled, it might do stuff like handling redirect and cookie handling on its own - which actually might impact the way your application is designed to work. (I have seen at least the MDS simulator behaving like this). Now if you are enterprise customer and if you don’t have MDS enabled, you are basically dependent on the carrier's support for WAP gateway/proxy or direct TCP access. If your app needs direct connection and cannot use the WAP gateway due to security reasons (WAP gap), you almost have to break the app's portability by having to append an "invalid" (it uses a ";" instead of "?" Or "&") parameter to your URLs while opening the connection! For e.g.: https://myserver.com/myapp?myparam=true;deviceside=true. (Now if you think that's weird, you should see the URL for the WAP proxy!!!) . The direct connection would work only if it is supported by the carrier (Check this link for details on carrier support and config info - very useful). Anyways, your app can still be portable, by adding the extra stuff only for blackberry devices - thanks to the "microedition.platform" system property.
For non-enterprise customers RIM provides an additional service called Blackberry internet service (which is nothing but a publicly hosted BES). However the access via BIS is open only to browsers - so far. The claim is that BIS shields the connectivity from any carrier specific configuration that needs to be set on the device (APN settings etc) which is true, (the BIS settings could be specified programmatically, again non standard I suspect) and might be useful especially when you are roaming. Also there is plenty of other custom APIs that RIM provides for encryption, XML manipulation and UI. However accesses to some of these are restricted only to apps signed with RIM certs - which is not free! Interesting stuff really, but I would rather wait for the RIM-NTP patent tussle to settle down before I dig in into those!
Even bigger pain is the connectivity, especially if your app need secure connections (https/TLS, SSL). Given that the J2ME support for HTTP spec is only partial (lack of "official" cookie support, DELETE, PUT methods, 302 redirect response handling etc), RIM makes it even more difficult with their custom connectivity options. First of all, if you are an enterprise customer, you are almost certain to have Blackberry Enterprise Server (BES) enabled. In that case all your connections by default go into your corporate intranet via BES and in order to connect to the outside world, you need Mobile Data Service (MDS) enabled within BES! Sometimes enterprise policies might not allow enabling MDS service altogether or might be restricted. Even if MDS is enabled, it might do stuff like handling redirect and cookie handling on its own - which actually might impact the way your application is designed to work. (I have seen at least the MDS simulator behaving like this). Now if you are enterprise customer and if you don’t have MDS enabled, you are basically dependent on the carrier's support for WAP gateway/proxy or direct TCP access. If your app needs direct connection and cannot use the WAP gateway due to security reasons (WAP gap), you almost have to break the app's portability by having to append an "invalid" (it uses a ";" instead of "?" Or "&") parameter to your URLs while opening the connection! For e.g.: https://myserver.com/myapp?myparam=true;deviceside=true. (Now if you think that's weird, you should see the URL for the WAP proxy!!!) . The direct connection would work only if it is supported by the carrier (Check this link for details on carrier support and config info - very useful). Anyways, your app can still be portable, by adding the extra stuff only for blackberry devices - thanks to the "microedition.platform" system property.
For non-enterprise customers RIM provides an additional service called Blackberry internet service (which is nothing but a publicly hosted BES). However the access via BIS is open only to browsers - so far. The claim is that BIS shields the connectivity from any carrier specific configuration that needs to be set on the device (APN settings etc) which is true, (the BIS settings could be specified programmatically, again non standard I suspect) and might be useful especially when you are roaming. Also there is plenty of other custom APIs that RIM provides for encryption, XML manipulation and UI. However accesses to some of these are restricted only to apps signed with RIM certs - which is not free! Interesting stuff really, but I would rather wait for the RIM-NTP patent tussle to settle down before I dig in into those!
Sunday, March 13, 2005
Moblogger MIDP2 version 0.9 released!
I am exited to announce that my mobile photo blogging application that I bloged about few weeks back is now an open source project at sourceforget.net. I started it as a fun project but then I started using it big time, so I figured it kind of made the case for an open source project. Moreover it has been a good learning experience for me as this is my first open source project. Guys at sourceforge.net are awsome I gotta tell ya! They provide such wonderful service with excellent support - for FREE! I think I'll briefly share my experience starting the project - in case you have a good project idea but could use some jump starting - documentation at sourceforge site is pretty exhaustive, exhaustive enough to scare away potential users!
First step is registering an account at sourceforge.net. All you need is a valid email id. Once you are registered and logged in, you need to raise a project registration request. There are a few steps you need to go though, specifying your project details, selecting the open source licence type that you would use, agreeing to sourceforge.net terms etc. Make sure you set a valid name with valid first and last names as your true identity on your account before hand. My project was rejected initially because I used my initials for last name - the usual indian way. Also make sure you have a good description of the project - some selling like why you think it should be an open source should help! But like I mentioned earlier, their support is amazing and normally your project should get approved in a day or two.
Once the project is approved, you could start the development. Since I already had a working version of the application, I just directly checked in the source after making some refinements, add proper comments etc. Sourceforge.net basically provides you with two types of server access. One is for CVS and other is a regular shell that you can use for running scripts, cron jobs etc. Btw ssh is the only mechanism to access the servers. You can follow these instructions to download and configure ssh tools (if you dont already have one) and generating keys. You have a couple of options with the source, you can either use the sourceforge.net CVS service or maintain it elsewhere and SFTP only downloadable version. I have checked in the source to sourceforge.net CVS. Again you can either use WinCVS(with ssh) as described here or directly logon to the shell and then access CVS from there. I choose to use the second option as I dont like WinCVS - bit clumsy for me.
In order to make your project publicly downloadable, you need to use the sourceforge File Release System by selecting "File Release" link from project Admin screen. Typically a downloadable module contains the source(ofcourse!), the executable/deployable, Release notes and documentation. You could generate the deployable module using the sourceforge.net complie farm. The compile options are quite exhaustive and supports a wide varitey of OSes and development platforms. But as I didnt find a J2ME compile option there, I decided not to inlcude a deployable version of Moblogger2 for the time being. Instead I added proper compliation and deployment instructions in my release notes. However you do have the option to create the release module in any place you choose to, it just need to be uploaded in a place as mentioned at the "File release system" documentation. You could use either Securecopy or SFTP to upload the release module.
Here's the best part: Your project gets a free custom website hosted by sourceforge.net which incidently has excellent web hosting facilities! You have full support for PHP4, Apache SSI, CGI (Perl, Python) and MySQL (yes you project gets your own MySQL db) - better than what most (cheap) commercial hosting providers has to offer. I have not created a homepage for Moblogger2 but its defenitley going to happen sometime soon. The URL is defaulted to projectname.sourceforge.net but you could configure to use your own domain if you have one. All you owe sourceforge.net is a small logo that you need to display on your site.
So would you like to contribute in Moblogger2? There sure is plenty of stuff to do: Support for Blogger API, Atom API etc.. the list looooong. Just add a comment below with your email and I will get in touch with you.
Sun certified Associate for J2SE
It seems Sun is launching a brand new certification titled "Sun Certified Associate for theJava 2 Platform, Version 1.0".
Though the details are not very clear at this point, this is supposed to be the new entry level certification in Java. From this post at Javaranch by one of sun's certification managers:
If you are a beginner or an expert who knows exactly what you'd belooking forSo would this make SCJP a level2 certification? Not sure about that but defenitely makes sense as there are more basic skills that one would expect from a junior developer than Core Java. I mean stuff like Web technologies and protocols, XML, Configuration management, team skills, IDE, OS basics etc are important too. Maybe more important than Core Java and SJCP in case of support and maintenence kind of roles - which is exactly what most entry level positions are. I bet this is the gap sun is addressing with this.
when hiring an entry level programmer into your team, thisis your opportunity to
get involved in the creation of the upcomingindustry leading certification exam.
The blueprint survey is on as usual so if you are a beta guy ;) ( you get free beta vouchers in case you didnt know), you can find the instructions to participate at Javaranch forum. I am participating in the survey but about the beta exam... ummm I think I'll say pass this time!
Friday, February 25, 2005
Non generic collections in J2SE 5.0
It seems you cannot use the plain old collection objects - the non generic versions aka "raw" collections - anymore without getting unchecked warnings!
The following code doesn't use any generics but compiler throws unchecked warnings as shown below:
List c = new ArrayList();
c.add(new Object());
>javac -Xlint Test.javaTest.java:10: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
c.add(new Object());
^
1 warning
Compiler has infact recognized the "raw" type but still decides to throw a generic related - note the type variable E - warning. Price for "guaranteed" type safety I guess!
Food for thought: IT folks are usually skeptical about the X.0 versions and tend to wait for the X.xx before taking the plunge!
Sun Generics tutorial bug
As per the Sun Generics tutorial page # 15, Section 7.3 - Arrays, you can declare array types whose element type is a type variable or a parameterized type, but not array objects.
The sample code there states that the following is legal but would generate unchecked warning.
List<String> c[] = new List<?>[10];
But actually this code doesn't compile and so it doesn't appear to be legal. It seems only unbounded wild cards are allowed for both array types and array objects. So following code is legal and it works too:
List<?> c[] = new List<?>[10];
Very strange this being the "official" tutorial. Hope someone fixes this soon.
Thursday, February 24, 2005
Free IBM certification vouchers!!!
IBM has started giving out free test vouchers (worth $175 ) again! It seems they do it every year for a limited period of time. Here's what you need to do - take the 10$ pre-assesment test at the IBM test site. This test is very easy and it seems they use the same set of questions. It is an online test anyway- no need to go to a test center ;) (Check this link in case you didnt get my drift!). IBM will send you the voucher in 3-4 days once you pass the test. To be eligible, you need to take the pre-assessment before this April 30th and the free voucher itself is valid only till June 30th. Here's the official announcement if you wanna take a look. Many people at Javaranch have already received thier free vouchers and there are only about a 400 or so left it seems - so hurry up and all the best!
Using Commons logging with Websphere
Having trouble running Jakartha commons logging with Websphere?
This IBM link might save you some pain!
Friday, February 11, 2005
SCJP5 (Tiger) , Generics and Concurrency
Took the Sun beta exam for SCJP5 (Tiger) yesterday. I had this free voucher and we were having knowledge sharing sessions on new Tiger features at work - which kind of helped me make my decision but the real point of attraction was the long 5 hour torture! I really wanted to see if I could stand the 5 hour marathon exam with 160+ questions. And I guess I made it even though I got burned out at the end! About after 4 hours into the test I could look at the questions and realize that it is a simple one, but couldn't get myself to concentrate enough to pick the right answer !!! Especially the ones with exhibits (code) - I didn't even bother to click those. I really wonder what the exam authors were thinking when they designed this mammoth. I mean it would be pretty hard to make a fair judgment on the difficulty level based on the test takers performance. Well.. Unless you go to the extreme extent of time slotting exam and judge difficulty level separately for each slots - provided the test engine is capable of capturing all necessary inputs for such an exhaustive analysis!
Content wise I think the exam was pretty tough - lots of generic and autoboxing stuff from the new feature side. But the ones that I got beaten up was the thread ones - not too tough technically but a whole set of lengthy code exhibits combined with the dreaded "this code will not compile/complier error" as a valid option makes them really really hard! However bit of a disappointment with the new concurrency stuff - not even a single question related to any of the new util.concurrent package or the new concurrent collections. Even though it is not explicitly mentioned in the exam objectives, I was expecting a few questions as I think this is one of the most important addition - maybe even more important than generics from a usability perspective. I mean this is stuff that we, Java developers, have been missing for a long time. Btw the drag and drop questions were fun - they have got it right this time and I really enjoyed those.
Anyway now that I'm done with it, I am happy I took it. And the news today at javaranch
is that the beta deadline got extended until March 6 - So plenty of time still if you want to take it - costs only 50$ instead of the regular 150$. But here's my advise - wait for the official 2 hour(or so) exam - because this five hour torture is definitely not worth it.
Wednesday, February 02, 2005
Free gmail accounts giveaway
I've got some gmail account to giveaway if you need. Add a comment with your email below and I'll send one your way - first come first serve! Btw if you didnt know already, you could get gmail invites by starting a blogger account. Thats how I got mine - not sure if it still works though..
Monday, January 31, 2005
SMTP email attachments from nokia 6600 using t-zones
I wanted to post images to flickr fom my phone and realized that the email app that comes with nokia 6600 (t-mobile) doesnt let you send attachments more than 1K! But as always there are workarounds in the net including an firmware upgrade(!) and using one of those third party email apps possibly with an external SMTP server - and people who tried these have had mixed results. To me, none of the options sounded very appealing so I decided to write my own midlet to send attachments. Moreover having my own midlet meant I can take pictures and send the same in one shot - was defenitely worth trying. So here's is what I did.
1. Use MMAPI to take pictures - basically followed the MMAPI sample program that comes with the WTK. I used VideoControl.USE_DIRECT_VIDEO display mode and png encoding for the snap shot. Here's the caveat: with MMAPI, you'll never get the same resolution as the native camera app. But that was OK, I was just gonna use it for moblogging.
2. Open a simple socket connection to myemail.t-mobile.com, port 25 and Send the picture that you captured using basic SMTP commands. T-mobile uses secure SMTP - so you need to pass in your creditials - no ssl though(btw 6600 do support ssl). Here goes the commands
a) EHLO
b) AUTH PLAIN {Base64 encoding of "\000" + user + "\000" + password}
c) MAIL FROM: < {your email addr} >
d) RCPT TO: < {flickr email addr} >
e) DATA
f) MIME-Version: 1.0
g) From: < {your email addr} >
h) To: < {flickr email addr}>
i) Subject: {some subject line}
j) Content-Type: multipart/mixed; boundary=" {some unique string} "
k) \r\n-- {my unique string}
l) Content-Type:image/png; name=image1.png");
m) Content-Disposition: attachment;filename="image1.png"
n) Content-transfer-encoding: base64
o) \r\n\r\n
p) {Base64 encoding of the image} - just google MIMEBase64 in case you need an impl.
q) \r\n-- {my unique string}
r) \r\n\r\n-- {my unique string} --\r\n
s) .
t) QUIT
3) Add some screens for configuration - email, server, port etc (throw in some RMS code also if you have the time), an Image thumbnail so you can select and preview before you post.
Thats it.. Done! Your very own moblog software is up n running in no time!
Wednesday, January 19, 2005
Tar Ant Task problem
I was using Tar task in one of my build scripts and ran into this error:
[tar] Nothing to do: XXX_XXX_1_0_0.tar is up to date.
This was weird because I got this error when I ran the script for the very first time. It turned out that I had the wrong entry for the "includes" attribute and so bascially tar couldnt find anything to tar up. Talk about misleading error messages!
Tuesday, January 11, 2005
Bluetooth internet with Nokia 6600 and t-zones
I got it working finally! I can now browse internet on my laptop using t-zones from my 6600. Well.. instructions are simple and is listed at a lot of places in the net. Here's is what I did
1. Subscribed to $4.99 t-zones connection from t-mobile. You get limited internet access - via the t-zones proxy - this way. You get to browse both WAP and regular HTML sites from the handset. I have accessed POP3 and SMTP also - not tried any other ports so far.
2. Configured DUN - dial up networking - from Laptop to 6600 over bluetooth. I use Blekin Bluetooth USB adapter - btw I had to update my windows bluetooth drivers with the ones from WIDCOMM. Enabled bluetooth and paired the phone. Set the Paired device (My Laptop) as authorised in the phone - so I dont need to enter PIN every time I connect.
3. Added the following connection string for the modem - In XP, control panel -> modems -> "Bluetooth Modem" (the one that I am using for my DUN) -> properties -> advaned ->Enter-> AT+cgdcont=1,"IP","wap.voicestream.com","",0,0
4. Changed the browser proxy (IE) for my modem connection - NOT the LAN one - as follows
Tools-> InternetOptions->connections -> Bluetooth Modem -> Settings-> Enable Proxy check box -> 216.155.165.50 port 8080.
5. Entered the dial up number for connection as *99# and blank for userid and password.
6. Also I uncheckd the "wait for dial tone" somewhere in the modem configuration.
Thats it. I'm up and running with my wireless internet connection. I felt the browsing speed and reliability is more or less the same as that of a regular dial up.
I got it working finally! I can now browse internet on my laptop using t-zones from my 6600. Well.. instructions are simple and is listed at a lot of places in the net. Here's is what I did
1. Subscribed to $4.99 t-zones connection from t-mobile. You get limited internet access - via the t-zones proxy - this way. You get to browse both WAP and regular HTML sites from the handset. I have accessed POP3 and SMTP also - not tried any other ports so far.
2. Configured DUN - dial up networking - from Laptop to 6600 over bluetooth. I use Blekin Bluetooth USB adapter - btw I had to update my windows bluetooth drivers with the ones from WIDCOMM. Enabled bluetooth and paired the phone. Set the Paired device (My Laptop) as authorised in the phone - so I dont need to enter PIN every time I connect.
3. Added the following connection string for the modem - In XP, control panel -> modems -> "Bluetooth Modem" (the one that I am using for my DUN) -> properties -> advaned ->Enter-> AT+cgdcont=1,"IP","wap.voicestream.com","",0,0
4. Changed the browser proxy (IE) for my modem connection - NOT the LAN one - as follows
Tools-> InternetOptions->connections -> Bluetooth Modem -> Settings-> Enable Proxy check box -> 216.155.165.50 port 8080.
5. Entered the dial up number for connection as *99# and blank for userid and password.
6. Also I uncheckd the "wait for dial tone" somewhere in the modem configuration.
Thats it. I'm up and running with my wireless internet connection. I felt the browsing speed and reliability is more or less the same as that of a regular dial up.
Wednesday, July 14, 2004
Subscribe to:
Posts (Atom)