Oh no. Its 2.8 GB memory of actually unused RAM. I have 8 GB RAM, and background process are using about 5 GB of it. And also, I tried reducing the number of training examples and also the length of the maximum padded input . The OOM error still exists even though the required space now is 153 MB , which should easily be managable.
I also have maxed out the RAM limit of the heap of pycharm software to 2048 MB. I really dont know what to do now… Anyways thank you for spending the time to help me!