1837, shortened form of cockroach, in contemporary writing said to be from a polite desire to avoid the sexual connotation in the first syllable; meaning "butt of a marijuana cigarette" is first recorded 1938, perhaps from resemblance to the insect, but perhaps a different word entirely.