10px~ gap between application and dock
It is actually 4px on non-retina displays.

I have tried using gdb and strings to find preference keys for removing the gap, but I haven't found anything. Most windows can't be resized so that they cover it with AppleScript either.

The only way I know to remove it is to disable Dock completely with for example launchctl unload /System/Library/LaunchAgents/com.apple.Dock.plist. But it also disables Mission Control, Launchpad, full screen windows, and the application switcher, and it makes desktop backgrounds gray.

A more practical workaround might be to make the desktop background (or parts of it on the side the Dock is on) solid black.