We observe electrically driven switching between stationary resistance states in a metal-dielectric composite system with hopping conduction, confined to a small volume. Sample preparation includes two main stages. First, a metal column consisting of Co and Cu layers is deposited in a via (channel) of dimensions 50 by 50, 100 by 100, 250 by 250, or 500 by 500 nanometers squared, etched by focused ion beams in a SiO_2 film. Then the microstructure is transformed irreversibly by application of a controlled high density current to the metal column. The transformation is manifested in both a considerable increase of resistance and a transition from metallic type of conduction to thermally activated tunneling. The resulting system is characterized by non-linear I-V curves with hysteresis. The resistance state can be switched by positive or negative voltage greater than 1.3V. The minimum switching time is less than 1ns. For interpretation of the switching and memory effects we apply the Simmons-Verderber model of charge trapping and release to a narrow dielectric gap containing metal granules.