Did you know? Blog


Slowdown and memory leak in ConcurrentLinkedQueue

Yesterday, I stumpled upon a rather interesting memory leak in Java’s ConcurrentLinkedQueue, I’d like to share with you. What is this all about The ConcurrentLinkedQueue leaks memory and slows down when removing the last element of a non-empty queue. Reproducing the problem So to reproduce the leak, we must constantly add and try to remove the last item of an initially filled queue. The following code is showing the problem quite well as it prints the duration it takes for every 10.000 iterations of adding and removing an object to the queue. import java.util.concurrent.ConcurrentLinkedQueue; public class TestLeak { public static...


Filesystem limitations of PHP’s metric tools

I’m quite heavily working with PHPMD/PDepend/PHPCPD on my local Windows machine to see, if I’ve written some mess before committing it. On some fridays I run it on the full project. Since, we added some node modules lately in our project and those modules have almost traditionally deep folder structures, I ran into a problem yesterday that is worth sharing. As most of you know, local paths in Windows’ NTFS are structured like this: drive letter, colon, and the folder structure separated by backslashes plus one terminating null character. So for example: C:\hello\world{NULL} But there are some limitations to that....