The following instructions are valid for a default installation of Ubuntu 18.04.2 LTS preinstalled with gcc make perl
For JDK 12 the same works except I've only confirmed it with binutils-2.29 and binutils-2.32
Pages: 1 2 3 4 5 6 7 8 9 10 11
The following instructions are valid for a default installation of Ubuntu 18.04.2 LTS preinstalled with gcc make perl
For JDK 12 the same works except I've only confirmed it with binutils-2.29 and binutils-2.32
...
I wanted to build hsdis for my Ubuntu system. Virtually all of the instructions out there are slightly wrong. As per the comment on this gist a recent change (bbd1da3f538f) to the HotSpot source to be compatible with binutils 2.29 broke all the prior instructions. So literally.. my contribution here is to publicly point this out and offer copy and pasta instructions to solve it.
Gist: https://gist.github.com/kay/ec70aa7469d216ab88eb411d8dab187d
...
This is helpful if you've a network involving a Windows host that you want to be able to resolve the hostname of your Linux hosts.
For Debian based distros, Ubuntu etc:
apt-get install libnss-winbind winbind samba
...
...
To add to my post on unit testing code that calls System.exit() I've wrote a little JUnit @Rule that allows you to set expectations in a simplified way.
The code is available on github.com/kay/assert-exit
Usage:
...
It sometimes comes up in the course of unit testing where a unit of code calls System.exit(status). If you've a sane codebase this is normally within a main class. Consider an insane codebase:
Consider
public class DisgruntledPenguin { public static boolean happy() { System.exit(5); } }
...
Looking through the unanswered Python questions on StackOverflow, I found one that seemed interesting.. "Python Get Screen Pixel Value in OS X" - how to access screen pixel values, without the overhead of calling the screencapture
command, then loading the resulting image.
After a bit of searching, the best supported way of grabbing a screenshot is provided by the CoreGraphics API, part of Quartz, specifically CGWindowListCreateImage
.
Since CoreGraphics is a C-based API, the code map almost directly to Python function calls. It's also simplified a bit, because PyObjC handles most of the memory-management (when the wrapping Python object goes out of scope, the underlying object is freed)
...
Memory leaks are difficult to trace down. A nice description of finding one is "A server memory leak", a story about tracing a memory leak in a Django application.
I'm trying to work out why a server process is slowly using more and more memory. The server parses a stream of text, and shoves stuff into a database. It's written in Python, and about the only external code it uses is SQLAlchemy
I found a combination of Meliae and objgraph useful. Pympler also seems useful (the tracker class particularly). Dowser also looks useful, and might have made things a bit easier..
...
A common problem we all have to deal with is fixing memory leaks. In garbage collecting languages like Java we typically expect not to ever need to worry about memory management. However the limitations of how a garbage collector works means that we can still create leaks. Which defeats the advantage of a garbage collector.
How do leaks get formed?
The Java GC determines which objects to collect by looking for references to the object. If there is no references, then the object is no longer in use and can be safely destroyed without making the application unstable. If an object is now unused but still referenced, a leak occurs. Let's create a leak:
...
There are four distinct forms of references in the JVM, and indeed many of these apply to other garbage collected languages.
It's important to know the differences, what affect they have on the collector and when you should be using them.
...