From some reference docs
The amount of memory Jenkins needs is largely dependent on many
factors, which is why the RAM allotted for it can range from 200 MB
for a small installation to 70+ GB for a single and massive Jenkins
master. However, you should be able to estimate the RAM required based
on your project build needs.
Each build node connection will take 2-3 threads, which equals about 2
MB or more of memory. You will also need to factor in CPU overhead for
Jenkins if there are a lot of users who will be accessing the Jenkins
user interface.
It is generally a bad practice to allocate executors on a master, as
builds can quickly overload a master’s CPU/memory/etc and crash the
instance, causing unnecessary downtime. Instead, it is advisable to
set up agents that the Jenkins master can delegate jobs to, keeping
the bulk of the work off of the masteritself.
A t2.micro has 1GB of RAM, which may be sufficient for testing. If you run out of RAM just move up to a larger t2 instance. Yes a t2.micro can be free for a year, but a t2.large with 8GB of RAM is only $0.128/hr. Turn it off when you're not using it and all you pay for is disk storage, which is $0.12/GB/month for general purpose SSD network attached storage (EBS).