Mayor Marion Barry backed off from his adamant opposition to building new jail space for D.C. prisoners yesterday and said space for expanding detention facilities might even be found in the District, something he has rejected in the past.

"We have space in the city for more detention facilities," for example at the current D.C. Jail site, but not for a whole new prison, Barry said after a Senate subcommittee hearing on jail overcrowding. He had testified that he "would have no objection" to more jail space being built "if we could figure out a way to afford it."

This is a reversal of position for the mayor, who said as recently as November during a press conference that he opposed building new jail facilities to help relieve overcrowding because judges would just fill up the new space by sending more people to jail.

Barry has come under increasing pressure to expand the city's prison capacity as he and other District officials are under court order to relieve overcrowding and law enforcement officials have predicted that more people will be sent to jail for longer periods of time.

D.C. corrections officials have said in the past that the only place to expand is at the Lorton Reformatory complex in Fairfax, while Northern Virginia officials have been trying for some time to close Lorton.

U.S. Attorney Joseph E. diGenova warned that the number of persons convicted and sent to D.C. prison facilities in 1985 and 1986, particularly serious drug offenders, is likely to "skyrocket."

"We need more jail and prison space," and these facilities should be built in the District, diGenova testified. The federal government is responsible for paying for them since the U.S. attorney's office is responsible for prosecuting almost all cases in the District, he said.

Barry, whose administration in the past has predicted a decline in the future prison population, said yesterday he agreed with diGenova on the trends on arrests and convictions and called the figures on increasing drug sales "frightening."

Sen. Arlen Specter (R-Pa.), who as chairman of the Senate Appropriations subcommittee on the District has authority over the city's budget, had said last month he would press Barry "a lot" on the issue of building new prison facilities for the District.

Specter and diGenova said the recent subway shootings in New York City, where a man shot four youths who reportedly asked him for money, is an example of what can happen when the public loses faith in the criminal justice system. Many New York residents hailed the man as a hero, though city officials there warned that this "vigilante" approach to justice was unacceptable.

"Vigilanteeism is a response when we don't have any law, order and justice," Specter said. "There is a real question" whether New York City has law, order and justice today, he added.

DiGenova said District residents have not decided to "turn to self-help" because they have faith in their criminal justice system.

Barry suggested that some of the Lorton population, such as some held on petty larceny charges, may not belong in jail. While saying he is not opposed to building new facilities and agreeing that the federal government should pay for any new construction, Barry said he is "advocating we not rush into building more jail cells until we see if there are alternatives" such as restitution or community service.

But diGenova said the D.C. prison population "is not soft" and said he suspected that those petty larceny cases were persons with several previous convictions.

In 1979, 19,300 adult misdemeanor and felony cases in the District, including 3,900 drug cases, were presented to the U.S. attorney's office for prosecution, diGenova said. The figures for all of 1984 are expected to exceed 25,000 overall, including about 9,500 for drugs, he estimated.

Felony indictments for drug trafficking in 1979 totaled 216, but there were more then 2,000 by early December this year, he said.

More drug arrests and convictions will continue, more mandatory sentences will be imposed, and sentences for serious offenses will be longer, diGenova predicted. Specter pointed out that new D.C. parole and probation guidelines, which he had pushed for successfully, are likely to result in more persons returning to prison when there is evidence they have used drugs.

"The District of Columbia has a serious potential problem here" with prospects of more incarcerations, he said. "A pattern is evolving where there is more of a need for more jail space."

Barry promised Specter a profile of the D.C. prison population in about a month so officials can analyze whether any inmates could properly be diverted to alternative programs.