The judge or court may allow to the receiver or person making said sale a reasonable compensation for his services, and the necessary costs for keeping and preserving the property.