This study is concerned with the enhancements of performance of associative memories by nonlinear transformations (mappings) of spaces of data to be associated. The data are first transformed into a new space and then the resulting objects (patterns) are stored in the memory. The objective of the transformations is to enhance the recall abilities of the memories. Nonlinear transformations are applied to (i) transform the input space, (ii) transform the output space and (iii) transform both input and output spaces. The transformations are realized in the form of piecewise linear functions whose parameters are optimized with the use of Particle Swarm Optimization (PSO). The optimization is carried out for one-way recall as well as for bi-directional recall. A comprehensive suite of experiments involves several types of associative memories such as correlation associative memories, fuzzy associative memories and morphological associative memories. The experiments reveal some interesting relationships between the parameters of the nonlinear mappings and the resulting quality of the recall. They also help quantify the capabilities of the nonlinear mappings to improve the quality of recall.