In this article, we propose an optimized version of the Hard Decision Decoder based on Hash and Syndrome Decoding (HSDec) decoder, named Reduced Memory Space of HSDec (RMS-HSDec), which uses less memory space. In this article, we aim to reduce the spatial complexity of the HSDec decoding algorithm while preserving its error correction capabilities. Our methodology involves allocating only the essential memory space for correctable error patterns and optimizing the hashing mechanism to effectively handle potential collisions. While maintaining the integrity of error correction, this new method guarantees memory reduction rates of over 96 % for the BCH(63, 39, 9) code and over 84 % for the QR(47, 24, 11) code compared to HSDec. Simulations were conducted to evaluate the performance of RMS-HSDec on various BCH and QR codes over AWGN and Rayleigh channels. The results demonstrated significant memory reduction rates and coding gains ranging from 0.8 dB to 2.8 dB over the AWGN channel and from 14 dB to 32 dB over the Rayleigh channel, confirming the robustness of the algorithm under different channel conditions. Comparative analyses showed that RMS-HSDec maintains competitive performance with existing decoders while offering effective error correction. These findings confirm the robustness of the RMS-HSDec algorithm under different channel conditions. Overall, the proposed decoder proves to be an effective solution, optimizing memory usage without compromising error correction capabilities, making it ideal for high-density data applications and environments with limited memory resources.