Home | Contents | Previous

Fixing Java Profiling in Eclipse (TPTP) on Linux (opensuse)

From: "andrew cooke" <andrew@...>

Date: Sat, 11 Oct 2008 17:39:14 -0400 (CLT)

Basically, see
http://www.woggie.net/2007/12/14/tptp-agent-controller-on-arch-linux/

Alternate details:

- When starting profiling, in the Properties dialog, you can select "Java
Profiling - JRE 1.5 or newer..." and then click the "Test Availability"
button.

- Assuming that fails, look at you log, which is in the .metadata folder
of your project.  Do "tail -f .metadata/.log" and you'll see error
messages like:

!ENTRY org.eclipse.tptp.platform.iac.administrator 4 0 2008-10-11
17:21:17.031
!MESSAGE [startIAC: Error Stream] RAServer generated the following output:
/home/andrew/pkg/eclipse/plugins/org.eclipse.tptp.platform.ac.linux_em64t_4.4.1.v200804021410/agent_controller/bin/ACStart.sh:
line 58: ../bin/ACServer: Permission denied

- To fix the system you have to get that running.  There are at least two
problems:

1 - You need to do chmod +x on the bin and lib directories (that fixes
"Permission denied" errors)
2 - You need to fix the soft links in the lib directory (if you do a ls-l
you'll see that a bunch of files that should be soft links are not) (that
fixes the "file too short" problem).

- You may also need to swicth to JDK 5 from JDK 6 (I read that somewhere
and am currently using JDK 5 - wil switch back later and report).

- You may also need to start the server manually.  This is done by:
export
TPTP_AC_HOME=/home/andrew/pkg/eclipse/plugins/org.eclipse.tptp.platform.ac.linux_em64t_4.4.1.v200804021410/agent_controller
(or wherever your error message points to)
and then running the ACStart.sh script.

Finally, here's what I used to fix the directories (thanks to emacs
autolearn!):

ln -s libnamedPipeTL.so.4.4.0 libnamedPipeTL.so.4
rm libprocessControlUtil.so
ln -s libprocessControlUtil.so.4.4.0 libprocessControlUtil.so
rm libprocessControlUtil.so.4
ln -s libprocessControlUtil.so.4.4.0 libprocessControlUtil.so.4
rm libsharedMemTL.so
ln -s libsharedMemTL.so.4.4.0 libsharedMemTL.so
rm libsharedMemTL.so.4
ln -s libsharedMemTL.so.4.4.0 libsharedMemTL.so.4
rm libsocketTL.so
ln -s libsocketTL.so.4.4.0 libsocketTL.so
rm libsocketTL.so.4
ln -s libsocketTL.so.4.4.0 libsocketTL.so.4
rm libtptpACTL.so
ln -s libtptpACTL.so.4.4.0 libtptpACTL.so
rm libtptpACTL.so.4
ln -s libtptpACTL.so.4.4.0 libtptpACTL.so.4
rm libtptpAgentBase.so
ln -s libtptpAgentBase.so.4.4.0 libtptpAgentBase.so
rm libtptpAgentBase.so.4
ln -s libtptpAgentBase.so.4.4.0 libtptpAgentBase.so.4
rm libtptpCCTL.so
ln -s libtptpCCTL.so.4.4.0 libtptpCCTL.so
rm libtptpCCTL.so.4
ln -s libtptpCCTL.so.4.4.0 libtptpCCTL.so.4
rm libtptpClient.so
ln -s libtptpClient.so.4.4.0 libtptpClient.so
rm libtptpClient.so.4
ln -s libtptpClient.so.4.4.0 libtptpClient.so.4
rm libtptpCmdExtr.so
ln -s libtptpCmdExtr.so.4.4.0 libtptpCmdExtr.so
rm libtptpCmdExtr.so.4
ln -s libtptpCmdExtr.so.4.4.0 libtptpCmdExtr.so.4
rm libtptpConfig.so
ln -s libtptpConfig.so.4.4.0 libtptpConfig.so
rm libtptpConfig.so.4
ln -s libtptpConfig.so.4.4.0 libtptpConfig.so.4
rm libtptpJava.so
ln -s libtptpJava.so.4.4.0 libtptpJava.so
rm libtptpJava.so.4
ln -s libtptpJava.so.4.4.0 libtptpJava.so.4
rm libTptpJSSE.so
ln -s libTptpJSSE.so.4.4.0 libTptpJSSE.so
rm libTptpJSSE.so.4
ln -s libTptpJSSE.so.4.4.0 libTptpJSSE.so.4
rm libtptpLogUtils.so
ln -s libtptpLogUtils.so.4.4.0 libtptpLogUtils.so
rm libtptpLogUtils.so.4
ln -s libtptpLogUtils.so.4.4.0 libtptpLogUtils.so.4
rm libtptpUtils.so
ln -s libtptpUtils.so.4.4.0 libtptpUtils.so
rm libtptpUtils.so.4
ln -s libtptpUtils.so.4.4.0 libtptpUtils.so.4
rm libtransportSupport.so
ln -s libtransportSupport.so.4.4.0 libtransportSupport.so
rm libtransportSupport.so.4
ln -s libtransportSupport.so.4.4.0 libtransportSupport.so.4

Nope

From: "andrew cooke" <andrew@...>

Date: Sat, 11 Oct 2008 18:24:46 -0400 (CLT)

Even with that I am unable to get things working.  I can test the
connection OK, but the process itself is unable to connect to port 10006
(although a telnet to that port indicates that ACServer is listening
there).

Seems like TPTP is not that great.

Andrew

Not Even with Latest Version

From: "andrew cooke" <andrew@...>

Date: Sat, 11 Oct 2008 22:14:27 -0400 (CLT)

This is blowing chunks.

I've installed a completely new Eclipse (3.4.1), updated it via the online
updater, and installed TPTP (4.5-4.5 depending on exact component, all via
online updater).

The install looks OK (previous errors with file flags fixed), but I get
the following when trying to profile:

Error occurred during initialization of VM
Could not find agent library on the library path or in the local
directory: JPIBootLoader

This is opensuse 11 (Linux) 64bit with JDK 1.5.0_16.

Andrew

It Works!

From: "andrew cooke" <andrew@...>

Date: Sat, 11 Oct 2008 22:19:45 -0400 (CLT)

I had an ACServer process running from previous attempts.  Killing that,
starting everything again, and it started.

So, a completely new, clean install with JDK5 and 3.4.1 does appear to work.

Andrew

Permalink | Comment on this post

Previous Entries

For comments, see relevant pages (permalinks).

New, Good Book by Le Carre?

From: "andrew cooke" <andrew@...>

Date: Fri, 10 Oct 2008 18:12:48 -0400 (CLT)

Review here - http://www.iht.com/bin/printfriendly.php?id=16820455

Andrew

Permalink

Possible Future Financial Scenario

From: "andrew cooke" <andrew@...>

Date: Fri, 10 Oct 2008 08:45:15 -0400 (CLT)

One way I can see the current mess playing out is through the creation of
huge conglomerates, which combine banking and industry (as may exist in
Japan?).  Think CitiGroup + General Electric + Walmart + Agro Industry. 
At the same time, countries will become less significant (since their GDPs
will be smaller than those of the huge companies).

Andrew

Permalink

Patriotic Taxes

From: "andrew cooke" <andrew@...>

Date: Wed, 8 Oct 2008 21:38:10 -0400 (CLT)

This article says pretty much what I thought at the time (although the
word "patriotic" wouldn't have been my first choice - I'd rather say that
paying taxes is part of belonging to the wider society)

http://iht.com/articles/2008/10/08/opinion/edfriedman.php

Andrew

Permalink

Using Packrat Parsing for Ruby

From: "andrew cooke" <andrew@...>

Date: Wed, 8 Oct 2008 07:35:02 -0400 (CLT)

I was going to post this comment at
http://blog.zenspider.com/2008/10/im-in-lexer-hell.html but had problems
with posting.


Not sure it would improve things, but it might be simpler if you left
things with an ambiguous grammar, then tried some variant of packrat
parsing.  If the parsing was lazy (to avoid exploring all the different
options) you could then have a second pass that goes through and selects
the right parse (using context to resolve ambiguities).

Not sure that makes sense (I've never done anything like that myself), but
it might result in cleaner code.  In python you might be able to implement
the packrat parsing using generators - don't know if that carries across
to ruby...


It doesn't seem like that crazy idea, but I don't know of anyone doing it.

Andrew

Permalink

Article on Robert Preston

From: "andrew cooke" <andrew@...>

Date: Fri, 3 Oct 2008 21:23:48 -0400 (CLT)

http://www.guardian.co.uk/media/2008/oct/04/bbc.creditcrunch

Anyone who's been following the unfolding economic crisis with the BBC
should recognise that name.  This is a good, short article that gives a
bit of background on the man (and the times).

Andrew

Permalink

China Intercepts and Stores Skype Messages

From: "andrew cooke" <andrew@...>

Date: Thu, 2 Oct 2008 08:41:25 -0400 (CLT)

http://iht.com/articles/2008/10/02/technology/02skype.php

Amazingly: "The researchers were able to download and analyze copies of
the surveillance data because the Chinese computers were improperly
configured, leaving them accessible."

Andrew

Permalink

World of Goo - Interesting Looking Puzzle Game

From: "andrew cooke" <andrew@...>

Date: Mon, 29 Sep 2008 09:15:59 -0400 (CLT)

http://www.rockpapershotgun.com/2008/09/29/world-exclusive-world-of-goo-review/

http://2dboy.com/games.php

Independent games 2008 winner.  The even mention Linux - if that's for
real, this may be the first game I buy since Elite....  In fact, I have
$20 in PayPal so why not?

Andrew

Permalink

Another Article on Models and Finance

From: "andrew cooke" <andrew@...>

Date: Mon, 29 Sep 2008 07:10:35 -0400 (CLT)

http://bits.blogs.nytimes.com/2008/09/18/how-wall-streets-quants-lied-to-their-computers/

Explains why risk management software didn't detect the coming problems.

Andrew

Permalink

iBatis ORM and Caching Strategy - a Use Case

From: "andrew cooke" <andrew@...>

Date: Sat, 27 Sep 2008 04:34:37 -0400 (CLT)

The Application

I am writing a Java application that presents information, stored in a
database, via a web server.  The presentation does not modify the data,
but the database does evolve, slowly, on disk (modified by other
processes).

The data themselves can be divided into two groups: first a set of related
objects that describe the system being measured (in this context they
could be considered "metadata"); second a set of measurements.  There are
many more measurements than there are metadata.

Some iBatis Details

iBatis provides very simple caching at the SQL statement level.  So if a
query is repeated with the same parameters then the result may be
retrieved from the cache.  The advantage of this approach is that it is
simple to implement and understand.  The disadvantage is that it is not
"intelligent", in that it does not recognise object identities.

For example, if I have two different queries that both return an instance
of the same class, iBatis will cache two different instances of the same
object for each key - one from each query.

iBatis is also limited in how it will map graphs - it does not provide
transparent retrieval of related objects.  So if one class references
another class then either both must be mapped in a single query to iBatis,
or a second call must be made explicitly (in which case the first instance
presumably contains a key that will be used to find the correct value).

This limitation can be removed by using a second layer - for example
Spring AOP.

My Solution

I have decided to use a very simple mapping approach with two levels of
cache.  The first level of cache is the iBatis statement cache; the second
is a set of maps from keys to instances for the "metadata" objects.  This
second level holds all metadata instances in-memory.  The caches are in a
singleton "database interface" class.

The connections between related objects are not explicit in the objects
themselves.  Instead, the "database interface" provides methods that
retrieve related objects (for example "List<Foo> getFoosForBaz(Baz)").

One drawback to this approach is that it is not very "OO".  The instances
do not form a graph that can be traversed directly.  For this particular
application that is not an issue - there is very little "analysis" of the
data (it is just "dumb presentation").

Another drawback is that for each metadata class the ORM manages two
different types - instances and keys.  iBatis must return instances when
asked for "all instances" to populate the cache, but must return only keys
when asked about relations between objects (the keys are then used to
retrieve instances from the second level cache).  In practice, with some
basic engineering (return factory objects rather than keys; these take the
"database interface" and extract the cached value), the extra work is
minimal.

The advantages are that the scheme is fast, compact, and relatively easy
to understand.  It is fast because almost all information is cached:
metadata instances are cached in the second level caches; relationships
are cached (as lists of keys) in the iBatis cache.  It is compact because
no duplicate instances are created (except when a cache expires).

The simplicity is not so obvious until you start to consider details like
cache expiry.  Because there are no explicit relations each pool of
instances (caches are grouped by class) can expire independently.  There
is no worry about instances being "trapped" in complex graphs.  There
should be no memory leaks.

This approach is very different to how I used SQLAlchemy in Python.  The
approach I used there was much more "sophisticated", with transparent,
lazy retrieval of related objects.  In that case I was writing a client
application that did not need to be long-lived, reliable, or efficient
(within reason, of course).

It's possible that I am being too conservative in this case.  Spring AOP
(or Hibernate) might have made the code more transparent at no extra cost
in practice.  But I think this was a reasonable approach to use here,
given the circumstances (both the application - particularly the "read
only" nature - and my limited knowledge).

Andrew

Permalink

Liberal Intellectuals, Foreigners and Fascism

From: "andrew cooke" <andrew@...>

Date: Thu, 25 Sep 2008 17:30:55 -0400 (CLT)

Why, oh why, do "liberal intellectuals" get such a hard-on over foreign
authority figures.  Surely it needs more than just "Americans are dumb" to
explain this -
http://www.boingboing.net/2008/09/24/japans-badass-new-pr.html

Maybe I'm just being lax in using the label "liberal intellectuals"?

Andrew

Permalink

Good Article on (Current) Economics

From: "andrew cooke" <andrew@...>

Date: Tue, 23 Sep 2008 20:36:01 -0400 (CLT)

http://www.lrb.co.uk/v30/n09/mack01_.html

An analysis from the LRB, published in May, that describes in detail what
has been happening.

Andrew

Permalink