I had 64 melons in my hand, my inventory was full, and there was 1 melon on the floor. When I through out a melon, it would be added to the stack on the floor visually, but I would still have 64 in my inventory. Then when I threw out the whole stack, the stack on the floor grew, but I still had 64 in my inventory. In these screenshots, there are 65 melons in total.
Environment
Windows 10, latest version of java, i7 8700k 12x, gtx 1070 ti
Duplicate of MC-120643