There is no simple calculation for the optimum RRSP contribution.
Your best contribution depends (among other things) on how much income you expect to get in future years, and how much income you expect to withdraw per year when you retire.
For an example of case 1, if you expect to get much more income next year than this year, then you may be better off claiming nothing this year and claiming it all next year when it offsets a higher tax rate.
For an example of case 2, if you intend to have an income of $100,000 from your RRSPs when you retire (on which you will pay about 30% tax) there is no point in making contributions that only get 5% tax back (unless it is a long time to retirement).
Because of this complexity it may be worth getting a tax advisor to help with large sums like this.
Let's look at your calculations. I'm going to assume you earn all you income and have no other tax credits. (Though note you also get credits for your EI and CPP contributions so don't forget to factor those in.)
It's best to think of this in terms of how much you reduce your taxable income. So I will talk about making a contribution of your income minus $30000 as "reducing your income to $30000". Obviously I don't mean actually reducing your income, but reducing your effective taxable income using RRSP claims.
It is true that it's never worth reducing your taxable income below the Ontario Personal Allowance. It is the lower of the allowances, so if you were to claim more than that it would get you no additional tax back. However if you were to claim less that the Ontario Personal Allowance, so your taxable income was the Federal PA (which is only slightly higher) you would only be getting back 5.05% tax credit on the difference. That is a very small rate. You might use those contributions to get yourself 20%, even 30%, tax back in a future year, depending on what you expect to earn. The next tax bracket up is only 20.05%, which is also pretty small and not worth claiming if you are regularly earning $90000 and paying 33.89% marginal in 2019, but normal and worth claiming if you are earning $50000 regularly and paying 29.65% marginal in 2019.
So it's complicated. The number you quote is not optimal. It is almost certainly never worth claiming more than that, but claiming less, even much less, may be a good idea depending on circumstances. Getting professional advice might save you thousands of dollars.